diff --git a/networks/he-burn/ase-big/Make.package b/networks/he-burn/ase-big/Make.package new file mode 100644 index 000000000..35413fdcf --- /dev/null +++ b/networks/he-burn/ase-big/Make.package @@ -0,0 +1,19 @@ +PYNUCASTRO_NETWORK = TRUE +CEXE_headers += network_properties.H + +ifeq ($(USE_REACT),TRUE) + CEXE_headers += actual_network.H + CEXE_headers += tfactors.H + CEXE_headers += interp_tools.H + CEXE_headers += partition_functions.H + CEXE_headers += actual_rhs.H + CEXE_headers += rate_type.H + CEXE_headers += reaclib_rates.H + CEXE_headers += approximate_rates.H + CEXE_headers += modified_rates.H + CEXE_headers += table_rates.H + CEXE_headers += temperature_table_rates.H + CEXE_headers += derived_rates.H + USE_SCREENING = TRUE + USE_NEUTRINOS = TRUE +endif diff --git a/networks/he-burn/ase-big/README.md b/networks/he-burn/ase-big/README.md new file mode 100644 index 000000000..f07bf2e05 --- /dev/null +++ b/networks/he-burn/ase-big/README.md @@ -0,0 +1,5 @@ +# `ase-iron` + +This network builds on `ase` and includes more iron-group nuclei. +Since there are several weak-rates, the NSE state will slowly vary due +to the Ye evolution. diff --git a/networks/he-burn/ase-big/_parameters b/networks/he-burn/ase-big/_parameters new file mode 100644 index 000000000..e7a017d5a --- /dev/null +++ b/networks/he-burn/ase-big/_parameters @@ -0,0 +1,2 @@ +@namespace: network + diff --git a/networks/he-burn/ase-big/actual_network.H b/networks/he-burn/ase-big/actual_network.H new file mode 100644 index 000000000..6dc0816cd --- /dev/null +++ b/networks/he-burn/ase-big/actual_network.H @@ -0,0 +1,1331 @@ +#ifndef actual_network_H +#define actual_network_H + +#include +#include + +#include +#include +#include + +#include +#include +#include + +using namespace amrex::literals; + + +inline +void actual_network_init() { + + +} + +constexpr std::string_view network_name = "pynucastro-cxx"; + +namespace network +{ + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + constexpr amrex::Real bion () { + using namespace Species; + + static_assert(spec >= 1 && spec <= NumSpec); + + // Set the binding energy of the element + + if constexpr (spec == N) { + return 0.0_rt; + } + else if constexpr (spec == H1) { + return 0.0_rt; + } + else if constexpr (spec == He4) { + return 28.295662457999697_rt; + } + else if constexpr (spec == C12) { + return 92.16173498399803_rt; + } + else if constexpr (spec == C13) { + return 97.10804378399916_rt; + } + else if constexpr (spec == C14) { + return 105.28447818399945_rt; + } + else if constexpr (spec == N13) { + return 94.10522604799917_rt; + } + else if constexpr (spec == N14) { + return 104.65860734799753_rt; + } + else if constexpr (spec == N15) { + return 115.49190414799887_rt; + } + else if constexpr (spec == O16) { + return 127.6193154119992_rt; + } + else if constexpr (spec == O17) { + return 131.76239561199873_rt; + } + else if constexpr (spec == O18) { + return 139.8077658120019_rt; + } + else if constexpr (spec == F18) { + return 137.36950247599816_rt; + } + else if constexpr (spec == F19) { + return 147.80136567599766_rt; + } + else if constexpr (spec == Ne20) { + return 160.64482384000075_rt; + } + else if constexpr (spec == Ne21) { + return 167.40598973999658_rt; + } + else if constexpr (spec == Ne22) { + return 177.77024384000106_rt; + } + else if constexpr (spec == Na22) { + return 174.14457080400098_rt; + } + else if constexpr (spec == Na23) { + return 186.56435240400242_rt; + } + else if constexpr (spec == Mg24) { + return 198.2570479679962_rt; + } + else if constexpr (spec == Mg25) { + return 205.5875680680001_rt; + } + else if constexpr (spec == Al26) { + return 211.89389913199557_rt; + } + else if constexpr (spec == Al27) { + return 224.95193723199915_rt; + } + else if constexpr (spec == Si28) { + return 236.53684539599638_rt; + } + else if constexpr (spec == Si29) { + return 245.01044789599834_rt; + } + else if constexpr (spec == P30) { + return 250.60519745999775_rt; + } + else if constexpr (spec == P31) { + return 262.9161999600037_rt; + } + else if constexpr (spec == S32) { + return 271.78016372399725_rt; + } + else if constexpr (spec == S33) { + return 280.42180302400084_rt; + } + else if constexpr (spec == Cl34) { + return 285.5650057879975_rt; + } + else if constexpr (spec == Cl35) { + return 298.20976388800045_rt; + } + else if constexpr (spec == Ar36) { + return 306.7167469519991_rt; + } + else if constexpr (spec == Ar37) { + return 315.50420305199077_rt; + } + else if constexpr (spec == K38) { + return 320.64625411599985_rt; + } + else if constexpr (spec == K39) { + return 333.7240072160057_rt; + } + else if constexpr (spec == Ca40) { + return 342.05218528000114_rt; + } + else if constexpr (spec == Ca41) { + return 350.4150113799915_rt; + } + else if constexpr (spec == Sc42) { + return 354.68707244399405_rt; + } + else if constexpr (spec == Sc43) { + return 366.82549054399715_rt; + } + else if constexpr (spec == Ti44) { + return 375.47496160800074_rt; + } + else if constexpr (spec == Ti45) { + return 385.0079797080034_rt; + } + else if constexpr (spec == V46) { + return 390.3625507720062_rt; + } + else if constexpr (spec == V47) { + return 403.3650388719979_rt; + } + else if constexpr (spec == Cr48) { + return 411.4679399359957_rt; + } + else if constexpr (spec == Cr49) { + return 422.05065803600155_rt; + } + else if constexpr (spec == Mn50) { + return 426.63411910000286_rt; + } + else if constexpr (spec == Mn51) { + return 440.321747199996_rt; + } + else if constexpr (spec == Mn52) { + return 450.8612552999912_rt; + } + else if constexpr (spec == Fe52) { + return 447.6996182639923_rt; + } + else if constexpr (spec == Fe53) { + return 458.38633636399754_rt; + } + else if constexpr (spec == Fe54) { + return 471.76475446399854_rt; + } + else if constexpr (spec == Fe55) { + return 481.06287256399816_rt; + } + else if constexpr (spec == Fe56) { + return 492.2599506639962_rt; + } + else if constexpr (spec == Co55) { + return 476.82912552799826_rt; + } + else if constexpr (spec == Co56) { + return 486.91094362799777_rt; + } + else if constexpr (spec == Co57) { + return 498.28746172798856_rt; + } + else if constexpr (spec == Ni56) { + return 483.9956965919919_rt; + } + else if constexpr (spec == Ni57) { + return 494.2434146919986_rt; + } + else if constexpr (spec == Ni58) { + return 506.4596327920008_rt; + } + else if constexpr (spec == Cu59) { + return 509.8782038560021_rt; + } + else if constexpr (spec == Zn60) { + return 514.9831749199948_rt; + } + + + // Return zero if we don't recognize the species. + return 0.0_rt; + } + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + constexpr amrex::Real mion () { + using namespace Species; + + static_assert(spec >= 1 && spec <= NumSpec); + + // Set the mass of the element + + if constexpr (spec == N) { + return 1.674927498034172e-24_rt; + } + else if constexpr (spec == H1) { + return 1.6735328377636005e-24_rt; + } + else if constexpr (spec == He4) { + return 6.646479071584587e-24_rt; + } + else if constexpr (spec == C12) { + return 1.99264687992e-23_rt; + } + else if constexpr (spec == C13) { + return 2.1592578700883826e-23_rt; + } + else if constexpr (spec == C14) { + return 2.3252930380658474e-23_rt; + } + else if constexpr (spec == N13) { + return 2.1596537049448796e-23_rt; + } + else if constexpr (spec == N14) { + return 2.3252651436495096e-23_rt; + } + else if constexpr (spec == N15) { + return 2.490826682883827e-23_rt; + } + else if constexpr (spec == O16) { + return 2.6560180592333686e-23_rt; + } + else if constexpr (spec == O17) { + return 2.822772237905709e-23_rt; + } + else if constexpr (spec == O18) { + return 2.9888307701990364e-23_rt; + } + else if constexpr (spec == F18) { + return 2.989125964092377e-23_rt; + } + else if constexpr (spec == F19) { + return 3.1547590653659727e-23_rt; + } + else if constexpr (spec == Ne20) { + return 3.3198227947612416e-23_rt; + } + else if constexpr (spec == Ne21) { + return 3.4861102572650884e-23_rt; + } + else if constexpr (spec == Ne22) { + return 3.651755410955497e-23_rt; + } + else if constexpr (spec == Na22) { + return 3.652262279854593e-23_rt; + } + else if constexpr (spec == Na23) { + return 3.817541002484691e-23_rt; + } + else if constexpr (spec == Mg24) { + return 3.9828098739467446e-23_rt; + } + else if constexpr (spec == Mg25) { + return 4.148995839845366e-23_rt; + } + else if constexpr (spec == Al26) { + return 4.315224917996432e-23_rt; + } + else if constexpr (spec == Al27) { + return 4.480389861070653e-23_rt; + } + else if constexpr (spec == Si28) { + return 4.6456779473820677e-23_rt; + } + else if constexpr (spec == Si29) { + return 4.811660140333913e-23_rt; + } + else if constexpr (spec == P30) { + return 4.978016069409398e-23_rt; + } + else if constexpr (spec == P31) { + return 5.14331418367544e-23_rt; + } + else if constexpr (spec == S32) { + return 5.309087322384128e-23_rt; + } + else if constexpr (spec == S33) { + return 5.475039560055494e-23_rt; + } + else if constexpr (spec == Cl34) { + return 5.641475984659597e-23_rt; + } + else if constexpr (spec == Cl35) { + return 5.806714601585715e-23_rt; + } + else if constexpr (spec == Ar36) { + return 5.972551377884467e-23_rt; + } + else if constexpr (spec == Ar37) { + return 6.138477621350144e-23_rt; + } + else if constexpr (spec == K38) { + return 6.304914251263421e-23_rt; + } + else if constexpr (spec == K39) { + return 6.470075679819664e-23_rt; + } + else if constexpr (spec == Ca40) { + return 6.635944331004904e-23_rt; + } + else if constexpr (spec == Ca41) { + return 6.801946271643761e-23_rt; + } + else if constexpr (spec == Sc42) { + return 6.968537991361557e-23_rt; + } + else if constexpr (spec == Sc43) { + return 7.133866871591414e-23_rt; + } + else if constexpr (spec == Ti44) { + return 7.299678247096977e-23_rt; + } + else if constexpr (spec == Ti45) { + return 7.465471582063894e-23_rt; + } + else if constexpr (spec == V46) { + return 7.631870326846012e-23_rt; + } + else if constexpr (spec == V47) { + return 7.797045172607207e-23_rt; + } + else if constexpr (spec == Cr48) { + return 7.962953983065421e-23_rt; + } + else if constexpr (spec == Cr49) { + return 8.128560192010424e-23_rt; + } + else if constexpr (spec == Mn50) { + return 8.295096399635981e-23_rt; + } + else if constexpr (spec == Mn51) { + return 8.460149108098279e-23_rt; + } + else if constexpr (spec == Mn52) { + return 8.625763019925445e-23_rt; + } + else if constexpr (spec == Fe52) { + return 8.626187166893794e-23_rt; + } + else if constexpr (spec == Fe53) { + return 8.791774836154814e-23_rt; + } + else if constexpr (spec == Fe54) { + return 8.95688266630639e-23_rt; + } + else if constexpr (spec == Fe55) { + return 9.122717876001846e-23_rt; + } + else if constexpr (spec == Fe56) { + return 9.288214565329033e-23_rt; + } + else if constexpr (spec == Co55) { + return 9.123333143937473e-23_rt; + } + else if constexpr (spec == Co56) { + return 9.289028646418131e-23_rt; + } + else if constexpr (spec == Co57) { + return 9.454493347659797e-23_rt; + } + else if constexpr (spec == Ni56) { + return 9.289408870379396e-23_rt; + } + else if constexpr (spec == Ni57) { + return 9.455074798498772e-23_rt; + } + else if constexpr (spec == Ni58) { + return 9.620389809618879e-23_rt; + } + else if constexpr (spec == Cu59) { + return 9.787133677749025e-23_rt; + } + else if constexpr (spec == Zn60) { + return 9.953576917772707e-23_rt; + } + + + // Return zero if we don't recognize the species. + return 0.0_rt; + } + + // Legacy (non-templated) interfaces + + AMREX_GPU_HOST_DEVICE AMREX_INLINE + amrex::Real bion (int spec) { + using namespace Species; + + amrex::Real b = 0.0_rt; + + // Set the binding energy of the element + amrex::constexpr_for<1, NumSpec+1>([&] (auto n) { + if (n == spec) { + b = bion(); + } + }); + + return b; + } + + AMREX_GPU_HOST_DEVICE AMREX_INLINE + amrex::Real mion (int spec) { + using namespace Species; + + amrex::Real m = 0.0_rt; + + amrex::constexpr_for<1, NumSpec+1>([&] (auto n) { + if (n == spec) { + m = mion(); + } + }); + + return m; + } +} + +namespace Rates +{ + + enum NetworkRates : + std::uint16_t + { + k_C14_to_N14_reaclib = 1, + k_N13_to_C13_reaclib = 2, + k_p_C12_to_N13_reaclib = 3, + k_He4_C12_to_O16_reaclib = 4, + k_p_C13_to_N14_reaclib = 5, + k_p_C14_to_N15_reaclib = 6, + k_He4_C14_to_O18_reaclib = 7, + k_He4_N14_to_F18_reaclib = 8, + k_p_N15_to_O16_reaclib = 9, + k_He4_N15_to_F19_reaclib = 10, + k_He4_O16_to_Ne20_reaclib = 11, + k_p_O17_to_F18_reaclib = 12, + k_He4_O17_to_Ne21_reaclib = 13, + k_p_O18_to_F19_reaclib = 14, + k_He4_O18_to_Ne22_reaclib = 15, + k_He4_F18_to_Na22_reaclib = 16, + k_p_F19_to_Ne20_reaclib = 17, + k_He4_F19_to_Na23_reaclib = 18, + k_He4_Ne20_to_Mg24_reaclib = 19, + k_p_Ne21_to_Na22_reaclib = 20, + k_He4_Ne21_to_Mg25_reaclib = 21, + k_p_Ne22_to_Na23_reaclib = 22, + k_He4_Na22_to_Al26_reaclib = 23, + k_p_Na23_to_Mg24_reaclib = 24, + k_He4_Na23_to_Al27_reaclib = 25, + k_He4_Mg24_to_Si28_reaclib = 26, + k_p_Mg25_to_Al26_reaclib = 27, + k_He4_Mg25_to_Si29_reaclib = 28, + k_He4_Al26_to_P30_reaclib = 29, + k_p_Al27_to_Si28_reaclib = 30, + k_He4_Al27_to_P31_reaclib = 31, + k_He4_Si28_to_S32_reaclib = 32, + k_p_Si29_to_P30_reaclib = 33, + k_He4_Si29_to_S33_reaclib = 34, + k_He4_P30_to_Cl34_reaclib = 35, + k_p_P31_to_S32_reaclib = 36, + k_He4_P31_to_Cl35_reaclib = 37, + k_He4_S32_to_Ar36_reaclib = 38, + k_p_S33_to_Cl34_reaclib = 39, + k_He4_S33_to_Ar37_reaclib = 40, + k_He4_Cl34_to_K38_reaclib = 41, + k_p_Cl35_to_Ar36_reaclib = 42, + k_He4_Cl35_to_K39_reaclib = 43, + k_He4_Ar36_to_Ca40_reaclib = 44, + k_p_Ar37_to_K38_reaclib = 45, + k_He4_Ar37_to_Ca41_reaclib = 46, + k_He4_K38_to_Sc42_reaclib = 47, + k_p_K39_to_Ca40_reaclib = 48, + k_He4_K39_to_Sc43_reaclib = 49, + k_He4_Ca40_to_Ti44_reaclib = 50, + k_p_Ca41_to_Sc42_reaclib = 51, + k_He4_Ca41_to_Ti45_reaclib = 52, + k_He4_Sc42_to_V46_reaclib = 53, + k_p_Sc43_to_Ti44_reaclib = 54, + k_He4_Sc43_to_V47_reaclib = 55, + k_He4_Ti44_to_Cr48_reaclib = 56, + k_p_Ti45_to_V46_reaclib = 57, + k_He4_Ti45_to_Cr49_reaclib = 58, + k_He4_V46_to_Mn50_reaclib = 59, + k_p_V47_to_Cr48_reaclib = 60, + k_He4_V47_to_Mn51_reaclib = 61, + k_He4_Cr48_to_Fe52_reaclib = 62, + k_p_Cr49_to_Mn50_reaclib = 63, + k_p_Mn51_to_Fe52_reaclib = 64, + k_He4_Mn51_to_Co55_reaclib = 65, + k_He4_Fe52_to_Ni56_reaclib = 66, + k_p_Co55_to_Ni56_reaclib = 67, + k_C12_C12_to_p_Na23_reaclib = 68, + k_C12_C12_to_He4_Ne20_reaclib = 69, + k_He4_N13_to_p_O16_reaclib = 70, + k_p_N15_to_He4_C12_reaclib = 71, + k_C12_O16_to_p_Al27_reaclib = 72, + k_C12_O16_to_He4_Mg24_reaclib = 73, + k_O16_O16_to_p_P31_reaclib = 74, + k_O16_O16_to_He4_Si28_reaclib = 75, + k_p_O17_to_He4_N14_reaclib = 76, + k_p_O18_to_He4_N15_reaclib = 77, + k_He4_F18_to_p_Ne21_reaclib = 78, + k_p_F19_to_He4_O16_reaclib = 79, + k_He4_F19_to_p_Ne22_reaclib = 80, + k_C12_Ne20_to_p_P31_reaclib = 81, + k_C12_Ne20_to_He4_Si28_reaclib = 82, + k_He4_Na22_to_p_Mg25_reaclib = 83, + k_p_Na23_to_He4_Ne20_reaclib = 84, + k_He4_Al26_to_p_Si29_reaclib = 85, + k_p_Al27_to_He4_Mg24_reaclib = 86, + k_He4_P30_to_p_S33_reaclib = 87, + k_p_P31_to_He4_Si28_reaclib = 88, + k_He4_Cl34_to_p_Ar37_reaclib = 89, + k_p_Cl35_to_He4_S32_reaclib = 90, + k_He4_K38_to_p_Ca41_reaclib = 91, + k_p_K39_to_He4_Ar36_reaclib = 92, + k_He4_Sc42_to_p_Ti45_reaclib = 93, + k_p_Sc43_to_He4_Ca40_reaclib = 94, + k_He4_Ti44_to_p_V47_reaclib = 95, + k_He4_V46_to_p_Cr49_reaclib = 96, + k_He4_Cr48_to_p_Mn51_reaclib = 97, + k_He4_Cr49_to_p_Mn52_reaclib = 98, + k_He4_Fe52_to_p_Co55_reaclib = 99, + k_He4_He4_He4_to_C12_reaclib = 100, + k_n_Mn50_to_Mn51_reaclib = 101, + k_n_Mn51_to_Mn52_reaclib = 102, + k_p_Mn52_to_Fe53_reaclib = 103, + k_He4_Mn52_to_Co56_reaclib = 104, + k_n_Fe52_to_Fe53_reaclib = 105, + k_n_Fe53_to_Fe54_reaclib = 106, + k_He4_Fe53_to_Ni57_reaclib = 107, + k_n_Fe54_to_Fe55_reaclib = 108, + k_p_Fe54_to_Co55_reaclib = 109, + k_He4_Fe54_to_Ni58_reaclib = 110, + k_n_Fe55_to_Fe56_reaclib = 111, + k_p_Fe55_to_Co56_reaclib = 112, + k_p_Fe56_to_Co57_reaclib = 113, + k_n_Co55_to_Co56_reaclib = 114, + k_He4_Co55_to_Cu59_reaclib = 115, + k_n_Co56_to_Co57_reaclib = 116, + k_p_Co56_to_Ni57_reaclib = 117, + k_p_Co57_to_Ni58_reaclib = 118, + k_n_Ni56_to_Ni57_reaclib = 119, + k_He4_Ni56_to_Zn60_reaclib = 120, + k_n_Ni57_to_Ni58_reaclib = 121, + k_p_Ni58_to_Cu59_reaclib = 122, + k_p_Cu59_to_Zn60_reaclib = 123, + k_He4_Mn50_to_p_Fe53_reaclib = 124, + k_He4_Mn51_to_p_Fe54_reaclib = 125, + k_He4_Mn52_to_p_Fe55_reaclib = 126, + k_n_Fe52_to_p_Mn52_reaclib = 127, + k_He4_Fe53_to_p_Co56_reaclib = 128, + k_n_Co55_to_p_Fe55_reaclib = 129, + k_n_Co55_to_He4_Mn52_reaclib = 130, + k_He4_Co55_to_p_Ni58_reaclib = 131, + k_n_Co56_to_p_Fe56_reaclib = 132, + k_p_Co57_to_He4_Fe54_reaclib = 133, + k_n_Ni56_to_p_Co56_reaclib = 134, + k_n_Ni56_to_He4_Fe53_reaclib = 135, + k_n_Ni57_to_p_Co57_reaclib = 136, + k_n_Ni57_to_He4_Fe54_reaclib = 137, + k_n_Ni58_to_He4_Fe55_reaclib = 138, + k_n_Cu59_to_He4_Co56_reaclib = 139, + k_p_Cu59_to_He4_Ni56_reaclib = 140, + k_n_Zn60_to_He4_Ni57_reaclib = 141, + k_Fe52_to_Mn52_weaktab = 142, + k_Mn52_to_Fe52_weaktab = 143, + k_Co55_to_Fe55_weaktab = 144, + k_Fe55_to_Co55_weaktab = 145, + k_Co56_to_Fe56_weaktab = 146, + k_Co56_to_Ni56_weaktab = 147, + k_Fe56_to_Co56_weaktab = 148, + k_Ni56_to_Co56_weaktab = 149, + k_Co57_to_Ni57_weaktab = 150, + k_Ni57_to_Co57_weaktab = 151, + k_n_to_p_weaktab = 152, + k_p_to_n_weaktab = 153, + k_F18_to_O18_weaktab = 154, + k_O18_to_F18_weaktab = 155, + k_Na22_to_Ne22_weaktab = 156, + k_Ne22_to_Na22_weaktab = 157, + k_N13_to_p_C12_derived = 158, + k_N14_to_p_C13_derived = 159, + k_N15_to_p_C14_derived = 160, + k_O16_to_p_N15_derived = 161, + k_O16_to_He4_C12_derived = 162, + k_O18_to_He4_C14_derived = 163, + k_F18_to_p_O17_derived = 164, + k_F18_to_He4_N14_derived = 165, + k_F19_to_p_O18_derived = 166, + k_F19_to_He4_N15_derived = 167, + k_Ne20_to_p_F19_derived = 168, + k_Ne20_to_He4_O16_derived = 169, + k_Ne21_to_He4_O17_derived = 170, + k_Ne22_to_He4_O18_derived = 171, + k_Na22_to_p_Ne21_derived = 172, + k_Na22_to_He4_F18_derived = 173, + k_Na23_to_p_Ne22_derived = 174, + k_Na23_to_He4_F19_derived = 175, + k_Mg24_to_p_Na23_derived = 176, + k_Mg24_to_He4_Ne20_derived = 177, + k_Mg25_to_He4_Ne21_derived = 178, + k_Al26_to_p_Mg25_derived = 179, + k_Al26_to_He4_Na22_derived = 180, + k_Al27_to_He4_Na23_derived = 181, + k_Si28_to_p_Al27_derived = 182, + k_Si28_to_He4_Mg24_derived = 183, + k_Si29_to_He4_Mg25_derived = 184, + k_P30_to_p_Si29_derived = 185, + k_P30_to_He4_Al26_derived = 186, + k_P31_to_He4_Al27_derived = 187, + k_S32_to_p_P31_derived = 188, + k_S32_to_He4_Si28_derived = 189, + k_S33_to_He4_Si29_derived = 190, + k_Cl34_to_p_S33_derived = 191, + k_Cl34_to_He4_P30_derived = 192, + k_Cl35_to_He4_P31_derived = 193, + k_Ar36_to_p_Cl35_derived = 194, + k_Ar36_to_He4_S32_derived = 195, + k_Ar37_to_He4_S33_derived = 196, + k_K38_to_p_Ar37_derived = 197, + k_K38_to_He4_Cl34_derived = 198, + k_K39_to_He4_Cl35_derived = 199, + k_Ca40_to_p_K39_derived = 200, + k_Ca40_to_He4_Ar36_derived = 201, + k_Ca41_to_He4_Ar37_derived = 202, + k_Sc42_to_p_Ca41_derived = 203, + k_Sc42_to_He4_K38_derived = 204, + k_Sc43_to_He4_K39_derived = 205, + k_Ti44_to_p_Sc43_derived = 206, + k_Ti44_to_He4_Ca40_derived = 207, + k_Ti45_to_He4_Ca41_derived = 208, + k_V46_to_p_Ti45_derived = 209, + k_V46_to_He4_Sc42_derived = 210, + k_V47_to_He4_Sc43_derived = 211, + k_Cr48_to_p_V47_derived = 212, + k_Cr48_to_He4_Ti44_derived = 213, + k_Cr49_to_He4_Ti45_derived = 214, + k_Mn50_to_p_Cr49_derived = 215, + k_Mn50_to_He4_V46_derived = 216, + k_Mn51_to_He4_V47_derived = 217, + k_Fe52_to_p_Mn51_derived = 218, + k_Fe52_to_He4_Cr48_derived = 219, + k_Co55_to_He4_Mn51_derived = 220, + k_Ni56_to_p_Co55_derived = 221, + k_Ni56_to_He4_Fe52_derived = 222, + k_C12_to_He4_He4_He4_derived = 223, + k_He4_C12_to_p_N15_derived = 224, + k_He4_N14_to_p_O17_derived = 225, + k_He4_N15_to_p_O18_derived = 226, + k_p_O16_to_He4_N13_derived = 227, + k_He4_O16_to_p_F19_derived = 228, + k_He4_Ne20_to_p_Na23_derived = 229, + k_He4_Ne20_to_C12_C12_derived = 230, + k_p_Ne21_to_He4_F18_derived = 231, + k_p_Ne22_to_He4_F19_derived = 232, + k_p_Na23_to_C12_C12_derived = 233, + k_He4_Mg24_to_p_Al27_derived = 234, + k_He4_Mg24_to_C12_O16_derived = 235, + k_p_Mg25_to_He4_Na22_derived = 236, + k_p_Al27_to_C12_O16_derived = 237, + k_He4_Si28_to_p_P31_derived = 238, + k_He4_Si28_to_C12_Ne20_derived = 239, + k_He4_Si28_to_O16_O16_derived = 240, + k_p_Si29_to_He4_Al26_derived = 241, + k_p_P31_to_C12_Ne20_derived = 242, + k_p_P31_to_O16_O16_derived = 243, + k_He4_S32_to_p_Cl35_derived = 244, + k_p_S33_to_He4_P30_derived = 245, + k_He4_Ar36_to_p_K39_derived = 246, + k_p_Ar37_to_He4_Cl34_derived = 247, + k_He4_Ca40_to_p_Sc43_derived = 248, + k_p_Ca41_to_He4_K38_derived = 249, + k_p_Ti45_to_He4_Sc42_derived = 250, + k_p_V47_to_He4_Ti44_derived = 251, + k_p_Cr49_to_He4_V46_derived = 252, + k_p_Mn51_to_He4_Cr48_derived = 253, + k_p_Mn52_to_He4_Cr49_derived = 254, + k_p_Co55_to_He4_Fe52_derived = 255, + k_Mn51_to_n_Mn50_derived = 256, + k_Mn52_to_n_Mn51_derived = 257, + k_Fe53_to_n_Fe52_derived = 258, + k_Fe53_to_p_Mn52_derived = 259, + k_Fe54_to_n_Fe53_derived = 260, + k_Fe55_to_n_Fe54_derived = 261, + k_Fe56_to_n_Fe55_derived = 262, + k_Co55_to_p_Fe54_derived = 263, + k_Co56_to_n_Co55_derived = 264, + k_Co56_to_p_Fe55_derived = 265, + k_Co56_to_He4_Mn52_derived = 266, + k_Co57_to_n_Co56_derived = 267, + k_Co57_to_p_Fe56_derived = 268, + k_Ni57_to_n_Ni56_derived = 269, + k_Ni57_to_p_Co56_derived = 270, + k_Ni57_to_He4_Fe53_derived = 271, + k_Ni58_to_n_Ni57_derived = 272, + k_Ni58_to_p_Co57_derived = 273, + k_Ni58_to_He4_Fe54_derived = 274, + k_Cu59_to_p_Ni58_derived = 275, + k_Cu59_to_He4_Co55_derived = 276, + k_Zn60_to_p_Cu59_derived = 277, + k_Zn60_to_He4_Ni56_derived = 278, + k_p_Mn52_to_n_Fe52_derived = 279, + k_He4_Mn52_to_n_Co55_derived = 280, + k_p_Fe53_to_He4_Mn50_derived = 281, + k_He4_Fe53_to_n_Ni56_derived = 282, + k_p_Fe54_to_He4_Mn51_derived = 283, + k_He4_Fe54_to_n_Ni57_derived = 284, + k_He4_Fe54_to_p_Co57_derived = 285, + k_p_Fe55_to_n_Co55_derived = 286, + k_p_Fe55_to_He4_Mn52_derived = 287, + k_He4_Fe55_to_n_Ni58_derived = 288, + k_p_Fe56_to_n_Co56_derived = 289, + k_p_Co56_to_n_Ni56_derived = 290, + k_p_Co56_to_He4_Fe53_derived = 291, + k_He4_Co56_to_n_Cu59_derived = 292, + k_p_Co57_to_n_Ni57_derived = 293, + k_He4_Ni56_to_p_Cu59_derived = 294, + k_He4_Ni57_to_n_Zn60_derived = 295, + k_p_Ni58_to_He4_Co55_derived = 296, + NumRates = k_p_Ni58_to_He4_Co55_derived + }; + + enum ScreenPairs : + std::uint8_t + { + k_p_Sc43 = 1, + k_p_Fe56 = 2, + k_He4_Ti44 = 3, + k_He4_Fe55 = 4, + k_He4_Mg24 = 5, + k_C12_O16 = 6, + k_p_Cr49 = 7, + k_He4_Na22 = 8, + k_p_V47 = 9, + k_p_Co55 = 10, + k_C12_C12 = 11, + k_p_Fe53 = 12, + k_He4_Cr49 = 13, + k_p_Al27 = 14, + k_He4_V47 = 15, + k_p_Mg25 = 16, + k_p_Ne22 = 17, + k_He4_O18 = 18, + k_p_Mn52 = 19, + k_He4_Ni56 = 20, + k_p_P31 = 21, + k_p_Si29 = 22, + k_p_Ni58 = 23, + k_p_O16 = 24, + k_He4_Mn52 = 25, + k_O16_O16 = 26, + k_He4_P31 = 27, + k_He4_N13 = 28, + k_He4_Si29 = 29, + k_p_Ar37 = 30, + k_p_F19 = 31, + k_He4_Ca40 = 32, + k_He4_K38 = 33, + k_He4_Ar36 = 34, + k_He4_F18 = 35, + k_He4_Sc43 = 36, + k_p_Ne21 = 37, + k_He4_Ne20 = 38, + k_p_Co56 = 39, + k_He4_Mn50 = 40, + k_p_Fe54 = 41, + k_He4_Co55 = 42, + k_He4_Fe53 = 43, + k_He4_Al27 = 44, + k_He4_Mg25 = 45, + k_p_Cl35 = 46, + k_p_S33 = 47, + k_He4_Cl34 = 48, + k_p_C12 = 49, + k_He4_O16 = 50, + k_He4_N14 = 51, + k_p_Ti45 = 52, + k_He4_Sc42 = 53, + k_p_O17 = 54, + k_p_C14 = 55, + k_He4_Ar37 = 56, + k_p_N15 = 57, + k_He4_F19 = 58, + k_He4_C14 = 59, + k_He4_Al26 = 60, + k_He4_Ne21 = 61, + k_He4_S32 = 62, + k_p_Cu59 = 63, + k_He4_P30 = 64, + k_He4_Co56 = 65, + k_He4_Si28 = 66, + k_He4_Fe54 = 67, + k_He4_Ni57 = 68, + k_He4_Be8 = 69, + k_p_Ca41 = 70, + k_p_Co57 = 71, + k_p_K39 = 72, + k_p_Fe55 = 73, + k_He4_Cl35 = 74, + k_p_C13 = 75, + k_He4_S33 = 76, + k_He4_C12 = 77, + k_He4_Ca41 = 78, + k_He4_K39 = 79, + k_p_O18 = 80, + k_He4_Cr48 = 81, + k_He4_Ti45 = 82, + k_He4_V46 = 83, + k_He4_O17 = 84, + k_He4_N15 = 85, + k_p_Mn51 = 86, + k_p_Na23 = 87, + k_He4_Fe52 = 88, + k_He4_Mn51 = 89, + k_He4_He4 = 90, + k_He4_Na23 = 91, + k_C12_Ne20 = 92, + NumScreenPairs = k_C12_Ne20 + }; + + // rate names -- note: the rates are 1-based, not zero-based, so we pad + // this vector with rate_names[0] = "" so the indices line up with the + // NetworkRates enum + + static const std::vector rate_names = { + "", // 0 + "C14_to_N14_reaclib", // 1, + "N13_to_C13_reaclib", // 2, + "p_C12_to_N13_reaclib", // 3, + "He4_C12_to_O16_reaclib", // 4, + "p_C13_to_N14_reaclib", // 5, + "p_C14_to_N15_reaclib", // 6, + "He4_C14_to_O18_reaclib", // 7, + "He4_N14_to_F18_reaclib", // 8, + "p_N15_to_O16_reaclib", // 9, + "He4_N15_to_F19_reaclib", // 10, + "He4_O16_to_Ne20_reaclib", // 11, + "p_O17_to_F18_reaclib", // 12, + "He4_O17_to_Ne21_reaclib", // 13, + "p_O18_to_F19_reaclib", // 14, + "He4_O18_to_Ne22_reaclib", // 15, + "He4_F18_to_Na22_reaclib", // 16, + "p_F19_to_Ne20_reaclib", // 17, + "He4_F19_to_Na23_reaclib", // 18, + "He4_Ne20_to_Mg24_reaclib", // 19, + "p_Ne21_to_Na22_reaclib", // 20, + "He4_Ne21_to_Mg25_reaclib", // 21, + "p_Ne22_to_Na23_reaclib", // 22, + "He4_Na22_to_Al26_reaclib", // 23, + "p_Na23_to_Mg24_reaclib", // 24, + "He4_Na23_to_Al27_reaclib", // 25, + "He4_Mg24_to_Si28_reaclib", // 26, + "p_Mg25_to_Al26_reaclib", // 27, + "He4_Mg25_to_Si29_reaclib", // 28, + "He4_Al26_to_P30_reaclib", // 29, + "p_Al27_to_Si28_reaclib", // 30, + "He4_Al27_to_P31_reaclib", // 31, + "He4_Si28_to_S32_reaclib", // 32, + "p_Si29_to_P30_reaclib", // 33, + "He4_Si29_to_S33_reaclib", // 34, + "He4_P30_to_Cl34_reaclib", // 35, + "p_P31_to_S32_reaclib", // 36, + "He4_P31_to_Cl35_reaclib", // 37, + "He4_S32_to_Ar36_reaclib", // 38, + "p_S33_to_Cl34_reaclib", // 39, + "He4_S33_to_Ar37_reaclib", // 40, + "He4_Cl34_to_K38_reaclib", // 41, + "p_Cl35_to_Ar36_reaclib", // 42, + "He4_Cl35_to_K39_reaclib", // 43, + "He4_Ar36_to_Ca40_reaclib", // 44, + "p_Ar37_to_K38_reaclib", // 45, + "He4_Ar37_to_Ca41_reaclib", // 46, + "He4_K38_to_Sc42_reaclib", // 47, + "p_K39_to_Ca40_reaclib", // 48, + "He4_K39_to_Sc43_reaclib", // 49, + "He4_Ca40_to_Ti44_reaclib", // 50, + "p_Ca41_to_Sc42_reaclib", // 51, + "He4_Ca41_to_Ti45_reaclib", // 52, + "He4_Sc42_to_V46_reaclib", // 53, + "p_Sc43_to_Ti44_reaclib", // 54, + "He4_Sc43_to_V47_reaclib", // 55, + "He4_Ti44_to_Cr48_reaclib", // 56, + "p_Ti45_to_V46_reaclib", // 57, + "He4_Ti45_to_Cr49_reaclib", // 58, + "He4_V46_to_Mn50_reaclib", // 59, + "p_V47_to_Cr48_reaclib", // 60, + "He4_V47_to_Mn51_reaclib", // 61, + "He4_Cr48_to_Fe52_reaclib", // 62, + "p_Cr49_to_Mn50_reaclib", // 63, + "p_Mn51_to_Fe52_reaclib", // 64, + "He4_Mn51_to_Co55_reaclib", // 65, + "He4_Fe52_to_Ni56_reaclib", // 66, + "p_Co55_to_Ni56_reaclib", // 67, + "C12_C12_to_p_Na23_reaclib", // 68, + "C12_C12_to_He4_Ne20_reaclib", // 69, + "He4_N13_to_p_O16_reaclib", // 70, + "p_N15_to_He4_C12_reaclib", // 71, + "C12_O16_to_p_Al27_reaclib", // 72, + "C12_O16_to_He4_Mg24_reaclib", // 73, + "O16_O16_to_p_P31_reaclib", // 74, + "O16_O16_to_He4_Si28_reaclib", // 75, + "p_O17_to_He4_N14_reaclib", // 76, + "p_O18_to_He4_N15_reaclib", // 77, + "He4_F18_to_p_Ne21_reaclib", // 78, + "p_F19_to_He4_O16_reaclib", // 79, + "He4_F19_to_p_Ne22_reaclib", // 80, + "C12_Ne20_to_p_P31_reaclib", // 81, + "C12_Ne20_to_He4_Si28_reaclib", // 82, + "He4_Na22_to_p_Mg25_reaclib", // 83, + "p_Na23_to_He4_Ne20_reaclib", // 84, + "He4_Al26_to_p_Si29_reaclib", // 85, + "p_Al27_to_He4_Mg24_reaclib", // 86, + "He4_P30_to_p_S33_reaclib", // 87, + "p_P31_to_He4_Si28_reaclib", // 88, + "He4_Cl34_to_p_Ar37_reaclib", // 89, + "p_Cl35_to_He4_S32_reaclib", // 90, + "He4_K38_to_p_Ca41_reaclib", // 91, + "p_K39_to_He4_Ar36_reaclib", // 92, + "He4_Sc42_to_p_Ti45_reaclib", // 93, + "p_Sc43_to_He4_Ca40_reaclib", // 94, + "He4_Ti44_to_p_V47_reaclib", // 95, + "He4_V46_to_p_Cr49_reaclib", // 96, + "He4_Cr48_to_p_Mn51_reaclib", // 97, + "He4_Cr49_to_p_Mn52_reaclib", // 98, + "He4_Fe52_to_p_Co55_reaclib", // 99, + "He4_He4_He4_to_C12_reaclib", // 100, + "n_Mn50_to_Mn51_reaclib", // 101, + "n_Mn51_to_Mn52_reaclib", // 102, + "p_Mn52_to_Fe53_reaclib", // 103, + "He4_Mn52_to_Co56_reaclib", // 104, + "n_Fe52_to_Fe53_reaclib", // 105, + "n_Fe53_to_Fe54_reaclib", // 106, + "He4_Fe53_to_Ni57_reaclib", // 107, + "n_Fe54_to_Fe55_reaclib", // 108, + "p_Fe54_to_Co55_reaclib", // 109, + "He4_Fe54_to_Ni58_reaclib", // 110, + "n_Fe55_to_Fe56_reaclib", // 111, + "p_Fe55_to_Co56_reaclib", // 112, + "p_Fe56_to_Co57_reaclib", // 113, + "n_Co55_to_Co56_reaclib", // 114, + "He4_Co55_to_Cu59_reaclib", // 115, + "n_Co56_to_Co57_reaclib", // 116, + "p_Co56_to_Ni57_reaclib", // 117, + "p_Co57_to_Ni58_reaclib", // 118, + "n_Ni56_to_Ni57_reaclib", // 119, + "He4_Ni56_to_Zn60_reaclib", // 120, + "n_Ni57_to_Ni58_reaclib", // 121, + "p_Ni58_to_Cu59_reaclib", // 122, + "p_Cu59_to_Zn60_reaclib", // 123, + "He4_Mn50_to_p_Fe53_reaclib", // 124, + "He4_Mn51_to_p_Fe54_reaclib", // 125, + "He4_Mn52_to_p_Fe55_reaclib", // 126, + "n_Fe52_to_p_Mn52_reaclib", // 127, + "He4_Fe53_to_p_Co56_reaclib", // 128, + "n_Co55_to_p_Fe55_reaclib", // 129, + "n_Co55_to_He4_Mn52_reaclib", // 130, + "He4_Co55_to_p_Ni58_reaclib", // 131, + "n_Co56_to_p_Fe56_reaclib", // 132, + "p_Co57_to_He4_Fe54_reaclib", // 133, + "n_Ni56_to_p_Co56_reaclib", // 134, + "n_Ni56_to_He4_Fe53_reaclib", // 135, + "n_Ni57_to_p_Co57_reaclib", // 136, + "n_Ni57_to_He4_Fe54_reaclib", // 137, + "n_Ni58_to_He4_Fe55_reaclib", // 138, + "n_Cu59_to_He4_Co56_reaclib", // 139, + "p_Cu59_to_He4_Ni56_reaclib", // 140, + "n_Zn60_to_He4_Ni57_reaclib", // 141, + "Fe52_to_Mn52_weaktab", // 142, + "Mn52_to_Fe52_weaktab", // 143, + "Co55_to_Fe55_weaktab", // 144, + "Fe55_to_Co55_weaktab", // 145, + "Co56_to_Fe56_weaktab", // 146, + "Co56_to_Ni56_weaktab", // 147, + "Fe56_to_Co56_weaktab", // 148, + "Ni56_to_Co56_weaktab", // 149, + "Co57_to_Ni57_weaktab", // 150, + "Ni57_to_Co57_weaktab", // 151, + "n_to_p_weaktab", // 152, + "p_to_n_weaktab", // 153, + "F18_to_O18_weaktab", // 154, + "O18_to_F18_weaktab", // 155, + "Na22_to_Ne22_weaktab", // 156, + "Ne22_to_Na22_weaktab", // 157, + "N13_to_p_C12_derived", // 158, + "N14_to_p_C13_derived", // 159, + "N15_to_p_C14_derived", // 160, + "O16_to_p_N15_derived", // 161, + "O16_to_He4_C12_derived", // 162, + "O18_to_He4_C14_derived", // 163, + "F18_to_p_O17_derived", // 164, + "F18_to_He4_N14_derived", // 165, + "F19_to_p_O18_derived", // 166, + "F19_to_He4_N15_derived", // 167, + "Ne20_to_p_F19_derived", // 168, + "Ne20_to_He4_O16_derived", // 169, + "Ne21_to_He4_O17_derived", // 170, + "Ne22_to_He4_O18_derived", // 171, + "Na22_to_p_Ne21_derived", // 172, + "Na22_to_He4_F18_derived", // 173, + "Na23_to_p_Ne22_derived", // 174, + "Na23_to_He4_F19_derived", // 175, + "Mg24_to_p_Na23_derived", // 176, + "Mg24_to_He4_Ne20_derived", // 177, + "Mg25_to_He4_Ne21_derived", // 178, + "Al26_to_p_Mg25_derived", // 179, + "Al26_to_He4_Na22_derived", // 180, + "Al27_to_He4_Na23_derived", // 181, + "Si28_to_p_Al27_derived", // 182, + "Si28_to_He4_Mg24_derived", // 183, + "Si29_to_He4_Mg25_derived", // 184, + "P30_to_p_Si29_derived", // 185, + "P30_to_He4_Al26_derived", // 186, + "P31_to_He4_Al27_derived", // 187, + "S32_to_p_P31_derived", // 188, + "S32_to_He4_Si28_derived", // 189, + "S33_to_He4_Si29_derived", // 190, + "Cl34_to_p_S33_derived", // 191, + "Cl34_to_He4_P30_derived", // 192, + "Cl35_to_He4_P31_derived", // 193, + "Ar36_to_p_Cl35_derived", // 194, + "Ar36_to_He4_S32_derived", // 195, + "Ar37_to_He4_S33_derived", // 196, + "K38_to_p_Ar37_derived", // 197, + "K38_to_He4_Cl34_derived", // 198, + "K39_to_He4_Cl35_derived", // 199, + "Ca40_to_p_K39_derived", // 200, + "Ca40_to_He4_Ar36_derived", // 201, + "Ca41_to_He4_Ar37_derived", // 202, + "Sc42_to_p_Ca41_derived", // 203, + "Sc42_to_He4_K38_derived", // 204, + "Sc43_to_He4_K39_derived", // 205, + "Ti44_to_p_Sc43_derived", // 206, + "Ti44_to_He4_Ca40_derived", // 207, + "Ti45_to_He4_Ca41_derived", // 208, + "V46_to_p_Ti45_derived", // 209, + "V46_to_He4_Sc42_derived", // 210, + "V47_to_He4_Sc43_derived", // 211, + "Cr48_to_p_V47_derived", // 212, + "Cr48_to_He4_Ti44_derived", // 213, + "Cr49_to_He4_Ti45_derived", // 214, + "Mn50_to_p_Cr49_derived", // 215, + "Mn50_to_He4_V46_derived", // 216, + "Mn51_to_He4_V47_derived", // 217, + "Fe52_to_p_Mn51_derived", // 218, + "Fe52_to_He4_Cr48_derived", // 219, + "Co55_to_He4_Mn51_derived", // 220, + "Ni56_to_p_Co55_derived", // 221, + "Ni56_to_He4_Fe52_derived", // 222, + "C12_to_He4_He4_He4_derived", // 223, + "He4_C12_to_p_N15_derived", // 224, + "He4_N14_to_p_O17_derived", // 225, + "He4_N15_to_p_O18_derived", // 226, + "p_O16_to_He4_N13_derived", // 227, + "He4_O16_to_p_F19_derived", // 228, + "He4_Ne20_to_p_Na23_derived", // 229, + "He4_Ne20_to_C12_C12_derived", // 230, + "p_Ne21_to_He4_F18_derived", // 231, + "p_Ne22_to_He4_F19_derived", // 232, + "p_Na23_to_C12_C12_derived", // 233, + "He4_Mg24_to_p_Al27_derived", // 234, + "He4_Mg24_to_C12_O16_derived", // 235, + "p_Mg25_to_He4_Na22_derived", // 236, + "p_Al27_to_C12_O16_derived", // 237, + "He4_Si28_to_p_P31_derived", // 238, + "He4_Si28_to_C12_Ne20_derived", // 239, + "He4_Si28_to_O16_O16_derived", // 240, + "p_Si29_to_He4_Al26_derived", // 241, + "p_P31_to_C12_Ne20_derived", // 242, + "p_P31_to_O16_O16_derived", // 243, + "He4_S32_to_p_Cl35_derived", // 244, + "p_S33_to_He4_P30_derived", // 245, + "He4_Ar36_to_p_K39_derived", // 246, + "p_Ar37_to_He4_Cl34_derived", // 247, + "He4_Ca40_to_p_Sc43_derived", // 248, + "p_Ca41_to_He4_K38_derived", // 249, + "p_Ti45_to_He4_Sc42_derived", // 250, + "p_V47_to_He4_Ti44_derived", // 251, + "p_Cr49_to_He4_V46_derived", // 252, + "p_Mn51_to_He4_Cr48_derived", // 253, + "p_Mn52_to_He4_Cr49_derived", // 254, + "p_Co55_to_He4_Fe52_derived", // 255, + "Mn51_to_n_Mn50_derived", // 256, + "Mn52_to_n_Mn51_derived", // 257, + "Fe53_to_n_Fe52_derived", // 258, + "Fe53_to_p_Mn52_derived", // 259, + "Fe54_to_n_Fe53_derived", // 260, + "Fe55_to_n_Fe54_derived", // 261, + "Fe56_to_n_Fe55_derived", // 262, + "Co55_to_p_Fe54_derived", // 263, + "Co56_to_n_Co55_derived", // 264, + "Co56_to_p_Fe55_derived", // 265, + "Co56_to_He4_Mn52_derived", // 266, + "Co57_to_n_Co56_derived", // 267, + "Co57_to_p_Fe56_derived", // 268, + "Ni57_to_n_Ni56_derived", // 269, + "Ni57_to_p_Co56_derived", // 270, + "Ni57_to_He4_Fe53_derived", // 271, + "Ni58_to_n_Ni57_derived", // 272, + "Ni58_to_p_Co57_derived", // 273, + "Ni58_to_He4_Fe54_derived", // 274, + "Cu59_to_p_Ni58_derived", // 275, + "Cu59_to_He4_Co55_derived", // 276, + "Zn60_to_p_Cu59_derived", // 277, + "Zn60_to_He4_Ni56_derived", // 278, + "p_Mn52_to_n_Fe52_derived", // 279, + "He4_Mn52_to_n_Co55_derived", // 280, + "p_Fe53_to_He4_Mn50_derived", // 281, + "He4_Fe53_to_n_Ni56_derived", // 282, + "p_Fe54_to_He4_Mn51_derived", // 283, + "He4_Fe54_to_n_Ni57_derived", // 284, + "He4_Fe54_to_p_Co57_derived", // 285, + "p_Fe55_to_n_Co55_derived", // 286, + "p_Fe55_to_He4_Mn52_derived", // 287, + "He4_Fe55_to_n_Ni58_derived", // 288, + "p_Fe56_to_n_Co56_derived", // 289, + "p_Co56_to_n_Ni56_derived", // 290, + "p_Co56_to_He4_Fe53_derived", // 291, + "He4_Co56_to_n_Cu59_derived", // 292, + "p_Co57_to_n_Ni57_derived", // 293, + "He4_Ni56_to_p_Cu59_derived", // 294, + "He4_Ni57_to_n_Zn60_derived", // 295, + "p_Ni58_to_He4_Co55_derived" // 296, + }; + + template + AMREX_GPU_DEVICE AMREX_INLINE + constexpr amrex::Real get_p_random() { + return 0.0_rt; + } + +} + +#ifdef NSE_NET +namespace NSE_INDEX +{ + // A RatePair data table, 2D array of shape (NumNSERatePairs, 10). + // Each row corresponds to a RatePair returned by _get_nse_rate_pairs(). + // Use enum names following NetworkSpecies and NetworkRates. + + // - Columns 1–3: 1-based index of reactant nuclei (forward rate) + // - Columns 4–6: 1-based index of product nuclei (forward rate) + // - Columns 7-8: 1-based index of non (n, H1, He4) nuclei. + // - Column 9: 1-based index of the forward rate + // - Column 10: 1-based index of the reverse rate + + using namespace Species; + using namespace Rates; + + constexpr int H1_index = 2; + constexpr int N_index = 1; + constexpr int He4_index = 3; + constexpr int NumNSERatePairs = 131; + + inline AMREX_GPU_MANAGED amrex::Array2D rate_pair_data { + H1, C12, -1, N13, -1, -1, C12, N13, k_p_C12_to_N13_reaclib, k_N13_to_p_C12_derived, + He4, C12, -1, O16, -1, -1, C12, O16, k_He4_C12_to_O16_reaclib, k_O16_to_He4_C12_derived, + H1, C13, -1, N14, -1, -1, C13, N14, k_p_C13_to_N14_reaclib, k_N14_to_p_C13_derived, + H1, C14, -1, N15, -1, -1, C14, N15, k_p_C14_to_N15_reaclib, k_N15_to_p_C14_derived, + He4, C14, -1, O18, -1, -1, C14, O18, k_He4_C14_to_O18_reaclib, k_O18_to_He4_C14_derived, + He4, N14, -1, F18, -1, -1, N14, F18, k_He4_N14_to_F18_reaclib, k_F18_to_He4_N14_derived, + H1, N15, -1, O16, -1, -1, N15, O16, k_p_N15_to_O16_reaclib, k_O16_to_p_N15_derived, + He4, N15, -1, F19, -1, -1, N15, F19, k_He4_N15_to_F19_reaclib, k_F19_to_He4_N15_derived, + He4, O16, -1, Ne20, -1, -1, O16, Ne20, k_He4_O16_to_Ne20_reaclib, k_Ne20_to_He4_O16_derived, + H1, O17, -1, F18, -1, -1, O17, F18, k_p_O17_to_F18_reaclib, k_F18_to_p_O17_derived, + He4, O17, -1, Ne21, -1, -1, O17, Ne21, k_He4_O17_to_Ne21_reaclib, k_Ne21_to_He4_O17_derived, + H1, O18, -1, F19, -1, -1, O18, F19, k_p_O18_to_F19_reaclib, k_F19_to_p_O18_derived, + He4, O18, -1, Ne22, -1, -1, O18, Ne22, k_He4_O18_to_Ne22_reaclib, k_Ne22_to_He4_O18_derived, + He4, F18, -1, Na22, -1, -1, F18, Na22, k_He4_F18_to_Na22_reaclib, k_Na22_to_He4_F18_derived, + H1, F19, -1, Ne20, -1, -1, F19, Ne20, k_p_F19_to_Ne20_reaclib, k_Ne20_to_p_F19_derived, + He4, F19, -1, Na23, -1, -1, F19, Na23, k_He4_F19_to_Na23_reaclib, k_Na23_to_He4_F19_derived, + He4, Ne20, -1, Mg24, -1, -1, Ne20, Mg24, k_He4_Ne20_to_Mg24_reaclib, k_Mg24_to_He4_Ne20_derived, + H1, Ne21, -1, Na22, -1, -1, Ne21, Na22, k_p_Ne21_to_Na22_reaclib, k_Na22_to_p_Ne21_derived, + He4, Ne21, -1, Mg25, -1, -1, Ne21, Mg25, k_He4_Ne21_to_Mg25_reaclib, k_Mg25_to_He4_Ne21_derived, + H1, Ne22, -1, Na23, -1, -1, Ne22, Na23, k_p_Ne22_to_Na23_reaclib, k_Na23_to_p_Ne22_derived, + He4, Na22, -1, Al26, -1, -1, Na22, Al26, k_He4_Na22_to_Al26_reaclib, k_Al26_to_He4_Na22_derived, + H1, Na23, -1, Mg24, -1, -1, Na23, Mg24, k_p_Na23_to_Mg24_reaclib, k_Mg24_to_p_Na23_derived, + He4, Na23, -1, Al27, -1, -1, Na23, Al27, k_He4_Na23_to_Al27_reaclib, k_Al27_to_He4_Na23_derived, + He4, Mg24, -1, Si28, -1, -1, Mg24, Si28, k_He4_Mg24_to_Si28_reaclib, k_Si28_to_He4_Mg24_derived, + H1, Mg25, -1, Al26, -1, -1, Mg25, Al26, k_p_Mg25_to_Al26_reaclib, k_Al26_to_p_Mg25_derived, + He4, Mg25, -1, Si29, -1, -1, Mg25, Si29, k_He4_Mg25_to_Si29_reaclib, k_Si29_to_He4_Mg25_derived, + He4, Al26, -1, P30, -1, -1, Al26, P30, k_He4_Al26_to_P30_reaclib, k_P30_to_He4_Al26_derived, + H1, Al27, -1, Si28, -1, -1, Al27, Si28, k_p_Al27_to_Si28_reaclib, k_Si28_to_p_Al27_derived, + He4, Al27, -1, P31, -1, -1, Al27, P31, k_He4_Al27_to_P31_reaclib, k_P31_to_He4_Al27_derived, + He4, Si28, -1, S32, -1, -1, Si28, S32, k_He4_Si28_to_S32_reaclib, k_S32_to_He4_Si28_derived, + H1, Si29, -1, P30, -1, -1, Si29, P30, k_p_Si29_to_P30_reaclib, k_P30_to_p_Si29_derived, + He4, Si29, -1, S33, -1, -1, Si29, S33, k_He4_Si29_to_S33_reaclib, k_S33_to_He4_Si29_derived, + He4, P30, -1, Cl34, -1, -1, P30, Cl34, k_He4_P30_to_Cl34_reaclib, k_Cl34_to_He4_P30_derived, + H1, P31, -1, S32, -1, -1, P31, S32, k_p_P31_to_S32_reaclib, k_S32_to_p_P31_derived, + He4, P31, -1, Cl35, -1, -1, P31, Cl35, k_He4_P31_to_Cl35_reaclib, k_Cl35_to_He4_P31_derived, + He4, S32, -1, Ar36, -1, -1, S32, Ar36, k_He4_S32_to_Ar36_reaclib, k_Ar36_to_He4_S32_derived, + H1, S33, -1, Cl34, -1, -1, S33, Cl34, k_p_S33_to_Cl34_reaclib, k_Cl34_to_p_S33_derived, + He4, S33, -1, Ar37, -1, -1, S33, Ar37, k_He4_S33_to_Ar37_reaclib, k_Ar37_to_He4_S33_derived, + He4, Cl34, -1, K38, -1, -1, Cl34, K38, k_He4_Cl34_to_K38_reaclib, k_K38_to_He4_Cl34_derived, + H1, Cl35, -1, Ar36, -1, -1, Cl35, Ar36, k_p_Cl35_to_Ar36_reaclib, k_Ar36_to_p_Cl35_derived, + He4, Cl35, -1, K39, -1, -1, Cl35, K39, k_He4_Cl35_to_K39_reaclib, k_K39_to_He4_Cl35_derived, + He4, Ar36, -1, Ca40, -1, -1, Ar36, Ca40, k_He4_Ar36_to_Ca40_reaclib, k_Ca40_to_He4_Ar36_derived, + H1, Ar37, -1, K38, -1, -1, Ar37, K38, k_p_Ar37_to_K38_reaclib, k_K38_to_p_Ar37_derived, + He4, Ar37, -1, Ca41, -1, -1, Ar37, Ca41, k_He4_Ar37_to_Ca41_reaclib, k_Ca41_to_He4_Ar37_derived, + He4, K38, -1, Sc42, -1, -1, K38, Sc42, k_He4_K38_to_Sc42_reaclib, k_Sc42_to_He4_K38_derived, + H1, K39, -1, Ca40, -1, -1, K39, Ca40, k_p_K39_to_Ca40_reaclib, k_Ca40_to_p_K39_derived, + He4, K39, -1, Sc43, -1, -1, K39, Sc43, k_He4_K39_to_Sc43_reaclib, k_Sc43_to_He4_K39_derived, + He4, Ca40, -1, Ti44, -1, -1, Ca40, Ti44, k_He4_Ca40_to_Ti44_reaclib, k_Ti44_to_He4_Ca40_derived, + H1, Ca41, -1, Sc42, -1, -1, Ca41, Sc42, k_p_Ca41_to_Sc42_reaclib, k_Sc42_to_p_Ca41_derived, + He4, Ca41, -1, Ti45, -1, -1, Ca41, Ti45, k_He4_Ca41_to_Ti45_reaclib, k_Ti45_to_He4_Ca41_derived, + He4, Sc42, -1, V46, -1, -1, Sc42, V46, k_He4_Sc42_to_V46_reaclib, k_V46_to_He4_Sc42_derived, + H1, Sc43, -1, Ti44, -1, -1, Sc43, Ti44, k_p_Sc43_to_Ti44_reaclib, k_Ti44_to_p_Sc43_derived, + He4, Sc43, -1, V47, -1, -1, Sc43, V47, k_He4_Sc43_to_V47_reaclib, k_V47_to_He4_Sc43_derived, + He4, Ti44, -1, Cr48, -1, -1, Ti44, Cr48, k_He4_Ti44_to_Cr48_reaclib, k_Cr48_to_He4_Ti44_derived, + H1, Ti45, -1, V46, -1, -1, Ti45, V46, k_p_Ti45_to_V46_reaclib, k_V46_to_p_Ti45_derived, + He4, Ti45, -1, Cr49, -1, -1, Ti45, Cr49, k_He4_Ti45_to_Cr49_reaclib, k_Cr49_to_He4_Ti45_derived, + He4, V46, -1, Mn50, -1, -1, V46, Mn50, k_He4_V46_to_Mn50_reaclib, k_Mn50_to_He4_V46_derived, + H1, V47, -1, Cr48, -1, -1, V47, Cr48, k_p_V47_to_Cr48_reaclib, k_Cr48_to_p_V47_derived, + He4, V47, -1, Mn51, -1, -1, V47, Mn51, k_He4_V47_to_Mn51_reaclib, k_Mn51_to_He4_V47_derived, + He4, Cr48, -1, Fe52, -1, -1, Cr48, Fe52, k_He4_Cr48_to_Fe52_reaclib, k_Fe52_to_He4_Cr48_derived, + H1, Cr49, -1, Mn50, -1, -1, Cr49, Mn50, k_p_Cr49_to_Mn50_reaclib, k_Mn50_to_p_Cr49_derived, + H1, Mn51, -1, Fe52, -1, -1, Mn51, Fe52, k_p_Mn51_to_Fe52_reaclib, k_Fe52_to_p_Mn51_derived, + He4, Mn51, -1, Co55, -1, -1, Mn51, Co55, k_He4_Mn51_to_Co55_reaclib, k_Co55_to_He4_Mn51_derived, + He4, Fe52, -1, Ni56, -1, -1, Fe52, Ni56, k_He4_Fe52_to_Ni56_reaclib, k_Ni56_to_He4_Fe52_derived, + H1, Co55, -1, Ni56, -1, -1, Co55, Ni56, k_p_Co55_to_Ni56_reaclib, k_Ni56_to_p_Co55_derived, + He4, N13, -1, H1, O16, -1, N13, O16, k_He4_N13_to_p_O16_reaclib, k_p_O16_to_He4_N13_derived, + H1, N15, -1, He4, C12, -1, N15, C12, k_p_N15_to_He4_C12_reaclib, k_He4_C12_to_p_N15_derived, + H1, O17, -1, He4, N14, -1, O17, N14, k_p_O17_to_He4_N14_reaclib, k_He4_N14_to_p_O17_derived, + H1, O18, -1, He4, N15, -1, O18, N15, k_p_O18_to_He4_N15_reaclib, k_He4_N15_to_p_O18_derived, + He4, F18, -1, H1, Ne21, -1, F18, Ne21, k_He4_F18_to_p_Ne21_reaclib, k_p_Ne21_to_He4_F18_derived, + H1, F19, -1, He4, O16, -1, F19, O16, k_p_F19_to_He4_O16_reaclib, k_He4_O16_to_p_F19_derived, + He4, F19, -1, H1, Ne22, -1, F19, Ne22, k_He4_F19_to_p_Ne22_reaclib, k_p_Ne22_to_He4_F19_derived, + He4, Na22, -1, H1, Mg25, -1, Na22, Mg25, k_He4_Na22_to_p_Mg25_reaclib, k_p_Mg25_to_He4_Na22_derived, + H1, Na23, -1, He4, Ne20, -1, Na23, Ne20, k_p_Na23_to_He4_Ne20_reaclib, k_He4_Ne20_to_p_Na23_derived, + He4, Al26, -1, H1, Si29, -1, Al26, Si29, k_He4_Al26_to_p_Si29_reaclib, k_p_Si29_to_He4_Al26_derived, + H1, Al27, -1, He4, Mg24, -1, Al27, Mg24, k_p_Al27_to_He4_Mg24_reaclib, k_He4_Mg24_to_p_Al27_derived, + He4, P30, -1, H1, S33, -1, P30, S33, k_He4_P30_to_p_S33_reaclib, k_p_S33_to_He4_P30_derived, + H1, P31, -1, He4, Si28, -1, P31, Si28, k_p_P31_to_He4_Si28_reaclib, k_He4_Si28_to_p_P31_derived, + He4, Cl34, -1, H1, Ar37, -1, Cl34, Ar37, k_He4_Cl34_to_p_Ar37_reaclib, k_p_Ar37_to_He4_Cl34_derived, + H1, Cl35, -1, He4, S32, -1, Cl35, S32, k_p_Cl35_to_He4_S32_reaclib, k_He4_S32_to_p_Cl35_derived, + He4, K38, -1, H1, Ca41, -1, K38, Ca41, k_He4_K38_to_p_Ca41_reaclib, k_p_Ca41_to_He4_K38_derived, + H1, K39, -1, He4, Ar36, -1, K39, Ar36, k_p_K39_to_He4_Ar36_reaclib, k_He4_Ar36_to_p_K39_derived, + He4, Sc42, -1, H1, Ti45, -1, Sc42, Ti45, k_He4_Sc42_to_p_Ti45_reaclib, k_p_Ti45_to_He4_Sc42_derived, + H1, Sc43, -1, He4, Ca40, -1, Sc43, Ca40, k_p_Sc43_to_He4_Ca40_reaclib, k_He4_Ca40_to_p_Sc43_derived, + He4, V46, -1, H1, Cr49, -1, V46, Cr49, k_He4_V46_to_p_Cr49_reaclib, k_p_Cr49_to_He4_V46_derived, + He4, Cr48, -1, H1, Mn51, -1, Cr48, Mn51, k_He4_Cr48_to_p_Mn51_reaclib, k_p_Mn51_to_He4_Cr48_derived, + He4, Cr49, -1, H1, Mn52, -1, Cr49, Mn52, k_He4_Cr49_to_p_Mn52_reaclib, k_p_Mn52_to_He4_Cr49_derived, + He4, Fe52, -1, H1, Co55, -1, Fe52, Co55, k_He4_Fe52_to_p_Co55_reaclib, k_p_Co55_to_He4_Fe52_derived, + He4, He4, He4, C12, -1, -1, C12, -1, k_He4_He4_He4_to_C12_reaclib, k_C12_to_He4_He4_He4_derived, + N, Mn50, -1, Mn51, -1, -1, Mn50, Mn51, k_n_Mn50_to_Mn51_reaclib, k_Mn51_to_n_Mn50_derived, + N, Mn51, -1, Mn52, -1, -1, Mn51, Mn52, k_n_Mn51_to_Mn52_reaclib, k_Mn52_to_n_Mn51_derived, + H1, Mn52, -1, Fe53, -1, -1, Mn52, Fe53, k_p_Mn52_to_Fe53_reaclib, k_Fe53_to_p_Mn52_derived, + He4, Mn52, -1, Co56, -1, -1, Mn52, Co56, k_He4_Mn52_to_Co56_reaclib, k_Co56_to_He4_Mn52_derived, + N, Fe52, -1, Fe53, -1, -1, Fe52, Fe53, k_n_Fe52_to_Fe53_reaclib, k_Fe53_to_n_Fe52_derived, + N, Fe53, -1, Fe54, -1, -1, Fe53, Fe54, k_n_Fe53_to_Fe54_reaclib, k_Fe54_to_n_Fe53_derived, + He4, Fe53, -1, Ni57, -1, -1, Fe53, Ni57, k_He4_Fe53_to_Ni57_reaclib, k_Ni57_to_He4_Fe53_derived, + N, Fe54, -1, Fe55, -1, -1, Fe54, Fe55, k_n_Fe54_to_Fe55_reaclib, k_Fe55_to_n_Fe54_derived, + H1, Fe54, -1, Co55, -1, -1, Fe54, Co55, k_p_Fe54_to_Co55_reaclib, k_Co55_to_p_Fe54_derived, + He4, Fe54, -1, Ni58, -1, -1, Fe54, Ni58, k_He4_Fe54_to_Ni58_reaclib, k_Ni58_to_He4_Fe54_derived, + N, Fe55, -1, Fe56, -1, -1, Fe55, Fe56, k_n_Fe55_to_Fe56_reaclib, k_Fe56_to_n_Fe55_derived, + H1, Fe55, -1, Co56, -1, -1, Fe55, Co56, k_p_Fe55_to_Co56_reaclib, k_Co56_to_p_Fe55_derived, + H1, Fe56, -1, Co57, -1, -1, Fe56, Co57, k_p_Fe56_to_Co57_reaclib, k_Co57_to_p_Fe56_derived, + N, Co55, -1, Co56, -1, -1, Co55, Co56, k_n_Co55_to_Co56_reaclib, k_Co56_to_n_Co55_derived, + He4, Co55, -1, Cu59, -1, -1, Co55, Cu59, k_He4_Co55_to_Cu59_reaclib, k_Cu59_to_He4_Co55_derived, + N, Co56, -1, Co57, -1, -1, Co56, Co57, k_n_Co56_to_Co57_reaclib, k_Co57_to_n_Co56_derived, + H1, Co56, -1, Ni57, -1, -1, Co56, Ni57, k_p_Co56_to_Ni57_reaclib, k_Ni57_to_p_Co56_derived, + H1, Co57, -1, Ni58, -1, -1, Co57, Ni58, k_p_Co57_to_Ni58_reaclib, k_Ni58_to_p_Co57_derived, + N, Ni56, -1, Ni57, -1, -1, Ni56, Ni57, k_n_Ni56_to_Ni57_reaclib, k_Ni57_to_n_Ni56_derived, + He4, Ni56, -1, Zn60, -1, -1, Ni56, Zn60, k_He4_Ni56_to_Zn60_reaclib, k_Zn60_to_He4_Ni56_derived, + N, Ni57, -1, Ni58, -1, -1, Ni57, Ni58, k_n_Ni57_to_Ni58_reaclib, k_Ni58_to_n_Ni57_derived, + H1, Ni58, -1, Cu59, -1, -1, Ni58, Cu59, k_p_Ni58_to_Cu59_reaclib, k_Cu59_to_p_Ni58_derived, + H1, Cu59, -1, Zn60, -1, -1, Cu59, Zn60, k_p_Cu59_to_Zn60_reaclib, k_Zn60_to_p_Cu59_derived, + He4, Mn50, -1, H1, Fe53, -1, Mn50, Fe53, k_He4_Mn50_to_p_Fe53_reaclib, k_p_Fe53_to_He4_Mn50_derived, + He4, Mn51, -1, H1, Fe54, -1, Mn51, Fe54, k_He4_Mn51_to_p_Fe54_reaclib, k_p_Fe54_to_He4_Mn51_derived, + He4, Mn52, -1, H1, Fe55, -1, Mn52, Fe55, k_He4_Mn52_to_p_Fe55_reaclib, k_p_Fe55_to_He4_Mn52_derived, + N, Fe52, -1, H1, Mn52, -1, Fe52, Mn52, k_n_Fe52_to_p_Mn52_reaclib, k_p_Mn52_to_n_Fe52_derived, + He4, Fe53, -1, H1, Co56, -1, Fe53, Co56, k_He4_Fe53_to_p_Co56_reaclib, k_p_Co56_to_He4_Fe53_derived, + N, Co55, -1, H1, Fe55, -1, Co55, Fe55, k_n_Co55_to_p_Fe55_reaclib, k_p_Fe55_to_n_Co55_derived, + N, Co55, -1, He4, Mn52, -1, Co55, Mn52, k_n_Co55_to_He4_Mn52_reaclib, k_He4_Mn52_to_n_Co55_derived, + He4, Co55, -1, H1, Ni58, -1, Co55, Ni58, k_He4_Co55_to_p_Ni58_reaclib, k_p_Ni58_to_He4_Co55_derived, + N, Co56, -1, H1, Fe56, -1, Co56, Fe56, k_n_Co56_to_p_Fe56_reaclib, k_p_Fe56_to_n_Co56_derived, + H1, Co57, -1, He4, Fe54, -1, Co57, Fe54, k_p_Co57_to_He4_Fe54_reaclib, k_He4_Fe54_to_p_Co57_derived, + N, Ni56, -1, H1, Co56, -1, Ni56, Co56, k_n_Ni56_to_p_Co56_reaclib, k_p_Co56_to_n_Ni56_derived, + N, Ni56, -1, He4, Fe53, -1, Ni56, Fe53, k_n_Ni56_to_He4_Fe53_reaclib, k_He4_Fe53_to_n_Ni56_derived, + N, Ni57, -1, H1, Co57, -1, Ni57, Co57, k_n_Ni57_to_p_Co57_reaclib, k_p_Co57_to_n_Ni57_derived, + N, Ni57, -1, He4, Fe54, -1, Ni57, Fe54, k_n_Ni57_to_He4_Fe54_reaclib, k_He4_Fe54_to_n_Ni57_derived, + N, Ni58, -1, He4, Fe55, -1, Ni58, Fe55, k_n_Ni58_to_He4_Fe55_reaclib, k_He4_Fe55_to_n_Ni58_derived, + N, Cu59, -1, He4, Co56, -1, Cu59, Co56, k_n_Cu59_to_He4_Co56_reaclib, k_He4_Co56_to_n_Cu59_derived, + H1, Cu59, -1, He4, Ni56, -1, Cu59, Ni56, k_p_Cu59_to_He4_Ni56_reaclib, k_He4_Ni56_to_p_Cu59_derived, + N, Zn60, -1, He4, Ni57, -1, Zn60, Ni57, k_n_Zn60_to_He4_Ni57_reaclib, k_He4_Ni57_to_n_Zn60_derived, + H1, V47, -1, He4, Ti44, -1, V47, Ti44, k_p_V47_to_He4_Ti44_derived, k_He4_Ti44_to_p_V47_reaclib + }; +} +#endif + +#endif diff --git a/networks/he-burn/ase-big/actual_network_data.cpp b/networks/he-burn/ase-big/actual_network_data.cpp new file mode 100644 index 000000000..143fe945b --- /dev/null +++ b/networks/he-burn/ase-big/actual_network_data.cpp @@ -0,0 +1,6 @@ +#include + +void actual_network_init() +{ + +} diff --git a/networks/he-burn/ase-big/actual_rhs.H b/networks/he-burn/ase-big/actual_rhs.H new file mode 100644 index 000000000..9a5472b67 --- /dev/null +++ b/networks/he-burn/ase-big/actual_rhs.H @@ -0,0 +1,10291 @@ +#ifndef ACTUAL_RHS_H +#define ACTUAL_RHS_H + +#include +#include + +#include +#include +#include +#include +#ifdef SCREENING +#include +#endif +#include +#ifdef NEUTRINOS +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +using namespace amrex::literals; +using namespace ArrayUtil; + +using namespace Species; +using namespace Rates; + +using namespace rate_tables; + +template +AMREX_GPU_DEVICE AMREX_INLINE +void ener_gener_rate(T const& dydt, amrex::Real& enuc) +{ + + // Computes the instantaneous energy generation rate (from the nuclei) + + // This is basically e = m c**2 + + enuc = 0.0_rt; + + amrex::constexpr_for<1, NumSpec+1>([&] (auto n) + { + enuc += dydt(n) * network::mion(); + }); + + enuc *= C::enuc_conv2; +} + + +#ifdef SCREENING +template +AMREX_GPU_DEVICE AMREX_INLINE +void evaluate_screening(const burn_t& state, + const amrex::Array1D& Y, + T& rate_eval) { + + // Evaluate screening terms + + using number_t = std::conditional_t; + number_t temp = state.T; + if constexpr (do_T_derivatives) { + // seed the dual number for temperature before calculating anything with it + autodiff::seed(temp); + } + + plasma_state_t pstate{}; + fill_plasma_state(pstate, temp, state.rho, Y); + + amrex::Real log_scor, dlog_scor_dT; + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 21.0_rt, 43.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Sc43) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Sc43) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 56.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Fe56) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Fe56) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 22.0_rt, 44.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ti44) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ti44) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 55.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Fe55) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Fe55) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 12.0_rt, 24.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Mg24) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Mg24) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(6.0_rt, 12.0_rt, 8.0_rt, 16.0_rt); + static_assert(scn_fac.z1 == 6.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_C12_O16) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_C12_O16) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 24.0_rt, 49.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Cr49) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Cr49) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 11.0_rt, 22.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Na22) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Na22) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 23.0_rt, 47.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_V47) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_V47) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 55.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Co55) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Co55) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(6.0_rt, 12.0_rt, 6.0_rt, 12.0_rt); + static_assert(scn_fac.z1 == 6.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_C12_C12) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_C12_C12) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 53.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Fe53) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Fe53) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 24.0_rt, 49.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Cr49) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Cr49) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 13.0_rt, 27.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Al27) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Al27) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 23.0_rt, 47.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_V47) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_V47) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 12.0_rt, 25.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Mg25) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Mg25) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 10.0_rt, 22.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Ne22) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Ne22) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 8.0_rt, 18.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_O18) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_O18) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 25.0_rt, 52.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Mn52) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Mn52) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 28.0_rt, 56.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ni56) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ni56) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 15.0_rt, 31.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_P31) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_P31) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 14.0_rt, 29.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Si29) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Si29) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 28.0_rt, 58.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Ni58) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Ni58) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 8.0_rt, 16.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_O16) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_O16) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 25.0_rt, 52.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Mn52) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Mn52) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(8.0_rt, 16.0_rt, 8.0_rt, 16.0_rt); + static_assert(scn_fac.z1 == 8.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_O16_O16) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_O16_O16) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 15.0_rt, 31.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_P31) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_P31) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 7.0_rt, 13.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_N13) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_N13) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 14.0_rt, 29.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Si29) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Si29) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 18.0_rt, 37.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Ar37) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Ar37) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 9.0_rt, 19.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_F19) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_F19) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 20.0_rt, 40.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ca40) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ca40) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 19.0_rt, 38.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_K38) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_K38) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 18.0_rt, 36.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ar36) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ar36) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 9.0_rt, 18.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_F18) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_F18) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 21.0_rt, 43.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Sc43) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Sc43) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 10.0_rt, 21.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Ne21) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Ne21) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 10.0_rt, 20.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ne20) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ne20) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 56.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Co56) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Co56) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 25.0_rt, 50.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Mn50) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Mn50) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 54.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Fe54) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Fe54) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 27.0_rt, 55.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Co55) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Co55) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 53.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Fe53) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Fe53) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 13.0_rt, 27.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Al27) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Al27) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 12.0_rt, 25.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Mg25) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Mg25) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 17.0_rt, 35.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Cl35) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Cl35) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 16.0_rt, 33.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_S33) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_S33) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 17.0_rt, 34.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Cl34) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Cl34) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 6.0_rt, 12.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_C12) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_C12) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 8.0_rt, 16.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_O16) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_O16) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 7.0_rt, 14.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_N14) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_N14) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 22.0_rt, 45.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Ti45) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Ti45) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 21.0_rt, 42.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Sc42) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Sc42) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 8.0_rt, 17.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_O17) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_O17) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 6.0_rt, 14.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_C14) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_C14) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 18.0_rt, 37.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ar37) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ar37) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 7.0_rt, 15.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_N15) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_N15) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 9.0_rt, 19.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_F19) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_F19) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 6.0_rt, 14.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_C14) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_C14) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 13.0_rt, 26.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Al26) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Al26) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 10.0_rt, 21.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ne21) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ne21) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 16.0_rt, 32.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_S32) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_S32) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 29.0_rt, 59.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Cu59) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Cu59) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 15.0_rt, 30.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_P30) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_P30) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 27.0_rt, 56.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Co56) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Co56) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 14.0_rt, 28.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Si28) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Si28) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 54.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Fe54) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Fe54) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 28.0_rt, 57.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ni57) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ni57) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 4.0_rt, 8.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Be8) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Be8) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 20.0_rt, 41.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Ca41) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Ca41) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 57.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Co57) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Co57) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 19.0_rt, 39.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_K39) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_K39) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 55.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Fe55) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Fe55) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 17.0_rt, 35.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Cl35) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Cl35) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 6.0_rt, 13.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_C13) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_C13) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 16.0_rt, 33.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_S33) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_S33) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 6.0_rt, 12.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_C12) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_C12) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 20.0_rt, 41.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ca41) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ca41) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 19.0_rt, 39.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_K39) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_K39) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 8.0_rt, 18.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_O18) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_O18) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 24.0_rt, 48.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Cr48) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Cr48) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 22.0_rt, 45.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Ti45) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Ti45) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 23.0_rt, 46.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_V46) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_V46) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 8.0_rt, 17.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_O17) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_O17) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 7.0_rt, 15.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_N15) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_N15) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 25.0_rt, 51.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Mn51) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Mn51) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 11.0_rt, 23.0_rt); + static_assert(scn_fac.z1 == 1.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_p_Na23) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_p_Na23) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 52.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Fe52) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Fe52) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 25.0_rt, 51.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Mn51) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Mn51) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 2.0_rt, 4.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_He4) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_He4) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 11.0_rt, 23.0_rt); + static_assert(scn_fac.z1 == 2.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_He4_Na23) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_He4_Na23) = dlog_scor_dT; + } + } + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(6.0_rt, 12.0_rt, 10.0_rt, 20.0_rt); + static_assert(scn_fac.z1 == 6.0_rt); + actual_log_screen(pstate, scn_fac, log_scor, dlog_scor_dT); + rate_eval.log_screen(k_C12_Ne20) = log_scor; + if constexpr (do_T_derivatives) { + rate_eval.dlog_screen_dT(k_C12_Ne20) = dlog_scor_dT; + } + } + +} +#endif + + +template +AMREX_GPU_DEVICE AMREX_INLINE +void evaluate_rates(const burn_t& state, + const amrex::Array1D& Y, + T& rate_eval) { + + // here Y is consistent with state.xn + + [[maybe_unused]] amrex::Real rhoy = state.rho * state.y_e; + + const tf_t tfactors = evaluate_tfactors(state.T); + + // Precompute screening terms + +#ifdef SCREENING + evaluate_screening(state, Y, rate_eval); +#endif + + // Fill in different rates + + fill_reaclib_rates(tfactors, rate_eval); + + temp_tabular::fill_rates(tfactors, rate_eval); + + // fill modified rates next -- these can have ReacLib or + // TemperatureTabular/StarLib rates as the original rate + modified_rates::fill_rates(tfactors, rate_eval); + + // Calculate Derived Rates next. This should go last but before + // approx rates, since those may have ReacLibRate, + // TemperatureTabularRate / StarLibRate, or DerivedRate as the + // underlying rate. + + fill_derived_rates(tfactors, rate_eval); + + + // Fill approximate rates + + fill_approx_rates(tfactors, state.rho, Y, rate_eval); + + // Calculate tabular weak rates + + [[maybe_unused]] amrex::Real rate, drate_dt, edot_nu, edot_gamma; + + rate_eval.enuc_weak = 0.0_rt; + + amrex::Real log_temp = std::log10(state.T); + amrex::Real log_rhoy = std::log10(rhoy); + + tabular_evaluate(j_Fe52_Mn52_meta, j_Fe52_Mn52_rhoy, j_Fe52_Mn52_temp, j_Fe52_Mn52_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Fe52_to_Mn52_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe52_to_Mn52_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Fe52) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Mn52_Fe52_meta, j_Mn52_Fe52_rhoy, j_Mn52_Fe52_temp, j_Mn52_Fe52_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Mn52_to_Fe52_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mn52_to_Fe52_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Mn52) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co55_Fe55_meta, j_Co55_Fe55_rhoy, j_Co55_Fe55_temp, j_Co55_Fe55_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co55_to_Fe55_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co55_to_Fe55_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Co55) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Fe55_Co55_meta, j_Fe55_Co55_rhoy, j_Fe55_Co55_temp, j_Fe55_Co55_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Fe55_to_Co55_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe55_to_Co55_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Fe55) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co56_Fe56_meta, j_Co56_Fe56_rhoy, j_Co56_Fe56_temp, j_Co56_Fe56_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co56_to_Fe56_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co56_to_Fe56_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Co56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co56_Ni56_meta, j_Co56_Ni56_rhoy, j_Co56_Ni56_temp, j_Co56_Ni56_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co56_to_Ni56_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co56_to_Ni56_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Co56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Fe56_Co56_meta, j_Fe56_Co56_rhoy, j_Fe56_Co56_temp, j_Fe56_Co56_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Fe56_to_Co56_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe56_to_Co56_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Fe56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Ni56_Co56_meta, j_Ni56_Co56_rhoy, j_Ni56_Co56_temp, j_Ni56_Co56_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Ni56_to_Co56_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni56_to_Co56_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Ni56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co57_Ni57_meta, j_Co57_Ni57_rhoy, j_Co57_Ni57_temp, j_Co57_Ni57_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co57_to_Ni57_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co57_to_Ni57_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Co57) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Ni57_Co57_meta, j_Ni57_Co57_rhoy, j_Ni57_Co57_temp, j_Ni57_Co57_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Ni57_to_Co57_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni57_to_Co57_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Ni57) * (edot_nu + edot_gamma); + + tabular_evaluate(j_n_p_meta, j_n_p_rhoy, j_n_p_temp, j_n_p_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_n_to_p_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_to_p_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(N) * (edot_nu + edot_gamma); + + tabular_evaluate(j_p_n_meta, j_p_n_rhoy, j_p_n_temp, j_p_n_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_p_to_n_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_to_n_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(H1) * (edot_nu + edot_gamma); + + tabular_evaluate(j_F18_O18_meta, j_F18_O18_rhoy, j_F18_O18_temp, j_F18_O18_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_F18_to_O18_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_F18_to_O18_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(F18) * (edot_nu + edot_gamma); + + tabular_evaluate(j_O18_F18_meta, j_O18_F18_rhoy, j_O18_F18_temp, j_O18_F18_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_O18_to_F18_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_O18_to_F18_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(O18) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Na22_Ne22_meta, j_Na22_Ne22_rhoy, j_Na22_Ne22_temp, j_Na22_Ne22_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Na22_to_Ne22_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Na22_to_Ne22_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Na22) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Ne22_Na22_meta, j_Ne22_Na22_rhoy, j_Ne22_Na22_temp, j_Ne22_Na22_data, + log_rhoy, log_temp, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Ne22_to_Na22_weaktab) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ne22_to_Na22_weaktab) = drate_dt; + } + rate_eval.enuc_weak += C::n_A * Y(Ne22) * (edot_nu + edot_gamma); + + +} + + +// backwards-compatible wrapper +template +AMREX_GPU_DEVICE AMREX_INLINE +void evaluate_rates(const burn_t& state, + T& rate_eval) { + + // create molar fractions + amrex::Array1D Y; + for (int n = 1; n <= NumSpec; ++n) { + Y(n) = state.xn[n-1] * aion_inv[n-1]; + } + + evaluate_rates(state, Y, rate_eval); +} + + +#ifdef NSE_NET +AMREX_GPU_DEVICE AMREX_INLINE +void get_ydot_weak(const burn_t& state, + amrex::Array1D& ydot_nuc, + amrex::Real& enuc_weak, + [[maybe_unused]] const amrex::Array1D& Y) { + /// + /// Calculate Ydots contribute only from weak reactions. + /// This is used to calculate dyedt and energy generation from + /// weak reactions for self-consistent NSE + /// + + using namespace modified_rates; + using namespace temp_tabular; + + // initialize ydot_nuc to 0 + + for (int i = 1; i <= neqs; ++i) { + ydot_nuc(i) = 0.0_rt; + } + + rate_t rate_eval; + + constexpr int do_T_derivatives = 0; + [[maybe_unused]] amrex::Real rate, drate_dT, edot_nu, edot_gamma; + [[maybe_unused]] amrex::Real rhoy = state.rho * state.y_e; + + rate_eval.enuc_weak = 0.0_rt; + + // Compute all weak rates and get ydot_weak + + const tf_t tfactors = evaluate_tfactors(state.T); + + { + // C14_to_N14_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_C14_to_N14_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C14_to_N14_reaclib) = rate; + } + + { + // N13_to_C13_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_N13_to_C13_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_N13_to_C13_reaclib) = rate; + } + + amrex::Real log_temp = std::log10(state.T); + amrex::Real log_rhoy = std::log10(rhoy); + + tabular_evaluate(j_Fe52_Mn52_meta, j_Fe52_Mn52_rhoy, j_Fe52_Mn52_temp, j_Fe52_Mn52_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Fe52_to_Mn52_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Fe52) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Mn52_Fe52_meta, j_Mn52_Fe52_rhoy, j_Mn52_Fe52_temp, j_Mn52_Fe52_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Mn52_to_Fe52_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Mn52) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co55_Fe55_meta, j_Co55_Fe55_rhoy, j_Co55_Fe55_temp, j_Co55_Fe55_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co55_to_Fe55_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Co55) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Fe55_Co55_meta, j_Fe55_Co55_rhoy, j_Fe55_Co55_temp, j_Fe55_Co55_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Fe55_to_Co55_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Fe55) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co56_Fe56_meta, j_Co56_Fe56_rhoy, j_Co56_Fe56_temp, j_Co56_Fe56_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co56_to_Fe56_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Co56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co56_Ni56_meta, j_Co56_Ni56_rhoy, j_Co56_Ni56_temp, j_Co56_Ni56_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co56_to_Ni56_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Co56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Fe56_Co56_meta, j_Fe56_Co56_rhoy, j_Fe56_Co56_temp, j_Fe56_Co56_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Fe56_to_Co56_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Fe56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Ni56_Co56_meta, j_Ni56_Co56_rhoy, j_Ni56_Co56_temp, j_Ni56_Co56_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Ni56_to_Co56_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Ni56) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Co57_Ni57_meta, j_Co57_Ni57_rhoy, j_Co57_Ni57_temp, j_Co57_Ni57_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Co57_to_Ni57_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Co57) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Ni57_Co57_meta, j_Ni57_Co57_rhoy, j_Ni57_Co57_temp, j_Ni57_Co57_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Ni57_to_Co57_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Ni57) * (edot_nu + edot_gamma); + + tabular_evaluate(j_n_p_meta, j_n_p_rhoy, j_n_p_temp, j_n_p_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_n_to_p_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(N) * (edot_nu + edot_gamma); + + tabular_evaluate(j_p_n_meta, j_p_n_rhoy, j_p_n_temp, j_p_n_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_p_to_n_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(H1) * (edot_nu + edot_gamma); + + tabular_evaluate(j_F18_O18_meta, j_F18_O18_rhoy, j_F18_O18_temp, j_F18_O18_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_F18_to_O18_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(F18) * (edot_nu + edot_gamma); + + tabular_evaluate(j_O18_F18_meta, j_O18_F18_rhoy, j_O18_F18_temp, j_O18_F18_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_O18_to_F18_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(O18) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Na22_Ne22_meta, j_Na22_Ne22_rhoy, j_Na22_Ne22_temp, j_Na22_Ne22_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Na22_to_Ne22_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Na22) * (edot_nu + edot_gamma); + + tabular_evaluate(j_Ne22_Na22_meta, j_Ne22_Na22_rhoy, j_Ne22_Na22_temp, j_Ne22_Na22_data, + log_rhoy, log_temp, state.T, rate, drate_dT, edot_nu, edot_gamma); + rate_eval.screened_rates(k_Ne22_to_Na22_weaktab) = rate; + rate_eval.enuc_weak += C::n_A * Y(Ne22) * (edot_nu + edot_gamma); + + + const auto& screened_rates = rate_eval.screened_rates; + + ydot_nuc(N) = + (-screened_rates(k_n_to_p_weaktab)*Y(N) + screened_rates(k_p_to_n_weaktab)*Y(H1)); + + ydot_nuc(H1) = + (screened_rates(k_n_to_p_weaktab)*Y(N) + -screened_rates(k_p_to_n_weaktab)*Y(H1)); + + ydot_nuc(He4) = 0.0_rt; + + ydot_nuc(C12) = 0.0_rt; + + ydot_nuc(C13) = + screened_rates(k_N13_to_C13_reaclib)*Y(N13); + + ydot_nuc(C14) = + -screened_rates(k_C14_to_N14_reaclib)*Y(C14); + + ydot_nuc(N13) = + -screened_rates(k_N13_to_C13_reaclib)*Y(N13); + + ydot_nuc(N14) = + screened_rates(k_C14_to_N14_reaclib)*Y(C14); + + ydot_nuc(N15) = 0.0_rt; + + ydot_nuc(O16) = 0.0_rt; + + ydot_nuc(O17) = 0.0_rt; + + ydot_nuc(O18) = + (screened_rates(k_F18_to_O18_weaktab)*Y(F18) + -screened_rates(k_O18_to_F18_weaktab)*Y(O18)); + + ydot_nuc(F18) = + (-screened_rates(k_F18_to_O18_weaktab)*Y(F18) + screened_rates(k_O18_to_F18_weaktab)*Y(O18)); + + ydot_nuc(F19) = 0.0_rt; + + ydot_nuc(Ne20) = 0.0_rt; + + ydot_nuc(Ne21) = 0.0_rt; + + ydot_nuc(Ne22) = + (screened_rates(k_Na22_to_Ne22_weaktab)*Y(Na22) + -screened_rates(k_Ne22_to_Na22_weaktab)*Y(Ne22)); + + ydot_nuc(Na22) = + (-screened_rates(k_Na22_to_Ne22_weaktab)*Y(Na22) + screened_rates(k_Ne22_to_Na22_weaktab)*Y(Ne22)); + + ydot_nuc(Na23) = 0.0_rt; + + ydot_nuc(Mg24) = 0.0_rt; + + ydot_nuc(Mg25) = 0.0_rt; + + ydot_nuc(Al26) = 0.0_rt; + + ydot_nuc(Al27) = 0.0_rt; + + ydot_nuc(Si28) = 0.0_rt; + + ydot_nuc(Si29) = 0.0_rt; + + ydot_nuc(P30) = 0.0_rt; + + ydot_nuc(P31) = 0.0_rt; + + ydot_nuc(S32) = 0.0_rt; + + ydot_nuc(S33) = 0.0_rt; + + ydot_nuc(Cl34) = 0.0_rt; + + ydot_nuc(Cl35) = 0.0_rt; + + ydot_nuc(Ar36) = 0.0_rt; + + ydot_nuc(Ar37) = 0.0_rt; + + ydot_nuc(K38) = 0.0_rt; + + ydot_nuc(K39) = 0.0_rt; + + ydot_nuc(Ca40) = 0.0_rt; + + ydot_nuc(Ca41) = 0.0_rt; + + ydot_nuc(Sc42) = 0.0_rt; + + ydot_nuc(Sc43) = 0.0_rt; + + ydot_nuc(Ti44) = 0.0_rt; + + ydot_nuc(Ti45) = 0.0_rt; + + ydot_nuc(V46) = 0.0_rt; + + ydot_nuc(V47) = 0.0_rt; + + ydot_nuc(Cr48) = 0.0_rt; + + ydot_nuc(Cr49) = 0.0_rt; + + ydot_nuc(Mn50) = 0.0_rt; + + ydot_nuc(Mn51) = 0.0_rt; + + ydot_nuc(Mn52) = + (screened_rates(k_Fe52_to_Mn52_weaktab)*Y(Fe52) + -screened_rates(k_Mn52_to_Fe52_weaktab)*Y(Mn52)); + + ydot_nuc(Fe52) = + (-screened_rates(k_Fe52_to_Mn52_weaktab)*Y(Fe52) + screened_rates(k_Mn52_to_Fe52_weaktab)*Y(Mn52)); + + ydot_nuc(Fe53) = 0.0_rt; + + ydot_nuc(Fe54) = 0.0_rt; + + ydot_nuc(Fe55) = + (screened_rates(k_Co55_to_Fe55_weaktab)*Y(Co55) + -screened_rates(k_Fe55_to_Co55_weaktab)*Y(Fe55)); + + ydot_nuc(Fe56) = + (screened_rates(k_Co56_to_Fe56_weaktab)*Y(Co56) + -screened_rates(k_Fe56_to_Co56_weaktab)*Y(Fe56)); + + ydot_nuc(Co55) = + (-screened_rates(k_Co55_to_Fe55_weaktab)*Y(Co55) + screened_rates(k_Fe55_to_Co55_weaktab)*Y(Fe55)); + + ydot_nuc(Co56) = + (-screened_rates(k_Co56_to_Fe56_weaktab)*Y(Co56) + screened_rates(k_Fe56_to_Co56_weaktab)*Y(Fe56)) + + (screened_rates(k_Ni56_to_Co56_weaktab)*Y(Ni56) + -screened_rates(k_Co56_to_Ni56_weaktab)*Y(Co56)); + + ydot_nuc(Co57) = + (screened_rates(k_Ni57_to_Co57_weaktab)*Y(Ni57) + -screened_rates(k_Co57_to_Ni57_weaktab)*Y(Co57)); + + ydot_nuc(Ni56) = + (-screened_rates(k_Ni56_to_Co56_weaktab)*Y(Ni56) + screened_rates(k_Co56_to_Ni56_weaktab)*Y(Co56)); + + ydot_nuc(Ni57) = + (-screened_rates(k_Ni57_to_Co57_weaktab)*Y(Ni57) + screened_rates(k_Co57_to_Ni57_weaktab)*Y(Co57)); + + ydot_nuc(Ni58) = 0.0_rt; + + ydot_nuc(Cu59) = 0.0_rt; + + ydot_nuc(Zn60) = 0.0_rt; + + enuc_weak = rate_eval.enuc_weak; +} +#endif + + +AMREX_GPU_DEVICE AMREX_INLINE +void rhs_nuc(const burn_t& state, + amrex::Array1D& ydot_nuc, + const amrex::Array1D& Y, + const amrex::Array1D& screened_rates) { + + using namespace Rates; + + ydot_nuc(N) = + (-screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(Mn50)*Y(N)*state.rho + screened_rates(k_Mn51_to_n_Mn50_derived)*Y(Mn51)) + + (-screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(Mn51)*Y(N)*state.rho + screened_rates(k_Mn52_to_n_Mn51_derived)*Y(Mn52)) + + (-screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_Fe53_to_n_Fe52_derived)*Y(Fe53)) + + (-screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(Fe53)*Y(N)*state.rho + screened_rates(k_Fe54_to_n_Fe53_derived)*Y(Fe54)) + + (-screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(Fe54)*Y(N)*state.rho + screened_rates(k_Fe55_to_n_Fe54_derived)*Y(Fe55)) + + (-screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_Fe56_to_n_Fe55_derived)*Y(Fe56)) + + (-screened_rates(k_n_Co55_to_Co56_reaclib)*Y(Co55)*Y(N)*state.rho + screened_rates(k_Co56_to_n_Co55_derived)*Y(Co56)) + + (-screened_rates(k_n_Co56_to_Co57_reaclib)*Y(Co56)*Y(N)*state.rho + screened_rates(k_Co57_to_n_Co56_derived)*Y(Co57)) + + (-screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(Ni56)*Y(N)*state.rho + screened_rates(k_Ni57_to_n_Ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(Ni57)*Y(N)*state.rho + screened_rates(k_Ni58_to_n_Ni57_derived)*Y(Ni58)) + + (-screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*Y(H1)*state.rho) + + (-screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*Y(N)*state.rho + screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (-screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*Y(N)*state.rho + screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*Y(Mn52)*state.rho) + + (-screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*Y(N)*state.rho + screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (-screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*Y(N)*state.rho + screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*Y(N)*state.rho + screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (-screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*Y(N)*state.rho + screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (-screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*Y(N)*state.rho + screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (-screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*Y(N)*state.rho + screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (-screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*Y(N)*state.rho + screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (-screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*Y(N)*state.rho + screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*Y(Ni57)*state.rho) + + (-screened_rates(k_n_to_p_weaktab)*Y(N) + screened_rates(k_p_to_n_weaktab)*Y(H1)); + + ydot_nuc(H1) = + (-screened_rates(k_p_C12_to_N13_reaclib)*Y(C12)*Y(H1)*state.rho + screened_rates(k_N13_to_p_C12_derived)*Y(N13)) + + (-screened_rates(k_p_C13_to_N14_reaclib)*Y(C13)*Y(H1)*state.rho + screened_rates(k_N14_to_p_C13_derived)*Y(N14)) + + (-screened_rates(k_p_C14_to_N15_reaclib)*Y(C14)*Y(H1)*state.rho + screened_rates(k_N15_to_p_C14_derived)*Y(N15)) + + (-screened_rates(k_p_N15_to_O16_reaclib)*Y(N15)*Y(H1)*state.rho + screened_rates(k_O16_to_p_N15_derived)*Y(O16)) + + (-screened_rates(k_p_O17_to_F18_reaclib)*Y(O17)*Y(H1)*state.rho + screened_rates(k_F18_to_p_O17_derived)*Y(F18)) + + (-screened_rates(k_p_O18_to_F19_reaclib)*Y(O18)*Y(H1)*state.rho + screened_rates(k_F19_to_p_O18_derived)*Y(F19)) + + (-screened_rates(k_p_F19_to_Ne20_reaclib)*Y(F19)*Y(H1)*state.rho + screened_rates(k_Ne20_to_p_F19_derived)*Y(Ne20)) + + (-screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(Ne21)*Y(H1)*state.rho + screened_rates(k_Na22_to_p_Ne21_derived)*Y(Na22)) + + (-screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(Ne22)*Y(H1)*state.rho + screened_rates(k_Na23_to_p_Ne22_derived)*Y(Na23)) + + (-screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_Mg24_to_p_Na23_derived)*Y(Mg24)) + + (-screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(Mg25)*Y(H1)*state.rho + screened_rates(k_Al26_to_p_Mg25_derived)*Y(Al26)) + + (-screened_rates(k_p_Al27_to_Si28_reaclib)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_Si28_to_p_Al27_derived)*Y(Si28)) + + (-screened_rates(k_p_Si29_to_P30_reaclib)*Y(Si29)*Y(H1)*state.rho + screened_rates(k_P30_to_p_Si29_derived)*Y(P30)) + + (-screened_rates(k_p_P31_to_S32_reaclib)*Y(P31)*Y(H1)*state.rho + screened_rates(k_S32_to_p_P31_derived)*Y(S32)) + + (-screened_rates(k_p_S33_to_Cl34_reaclib)*Y(S33)*Y(H1)*state.rho + screened_rates(k_Cl34_to_p_S33_derived)*Y(Cl34)) + + (-screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(Cl35)*Y(H1)*state.rho + screened_rates(k_Ar36_to_p_Cl35_derived)*Y(Ar36)) + + (-screened_rates(k_p_Ar37_to_K38_reaclib)*Y(Ar37)*Y(H1)*state.rho + screened_rates(k_K38_to_p_Ar37_derived)*Y(K38)) + + (-screened_rates(k_p_K39_to_Ca40_reaclib)*Y(K39)*Y(H1)*state.rho + screened_rates(k_Ca40_to_p_K39_derived)*Y(Ca40)) + + (-screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(Ca41)*Y(H1)*state.rho + screened_rates(k_Sc42_to_p_Ca41_derived)*Y(Sc42)) + + (-screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(Sc43)*Y(H1)*state.rho + screened_rates(k_Ti44_to_p_Sc43_derived)*Y(Ti44)) + + (-screened_rates(k_p_Ti45_to_V46_reaclib)*Y(Ti45)*Y(H1)*state.rho + screened_rates(k_V46_to_p_Ti45_derived)*Y(V46)) + + (-screened_rates(k_p_V47_to_Cr48_reaclib)*Y(V47)*Y(H1)*state.rho + screened_rates(k_Cr48_to_p_V47_derived)*Y(Cr48)) + + (-screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(Cr49)*Y(H1)*state.rho + screened_rates(k_Mn50_to_p_Cr49_derived)*Y(Mn50)) + + (-screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(Mn51)*Y(H1)*state.rho + screened_rates(k_Fe52_to_p_Mn51_derived)*Y(Fe52)) + + (-screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(Co55)*Y(H1)*state.rho + screened_rates(k_Ni56_to_p_Co55_derived)*Y(Ni56)) + + (0.5*screened_rates(k_C12_C12_to_p_Na23_reaclib)*amrex::Math::powi<2>(Y(C12))*state.rho + -screened_rates(k_p_Na23_to_C12_C12_derived)*Y(Na23)*Y(H1)*state.rho) + + (screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*Y(N13)*state.rho + -screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*Y(H1)*state.rho) + + (-screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*Y(H1)*state.rho + screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*Y(He4)*state.rho) + + (screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*Y(O16)*state.rho + -screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*Y(H1)*state.rho) + + (0.5*screened_rates(k_O16_O16_to_p_P31_reaclib)*amrex::Math::powi<2>(Y(O16))*state.rho + -screened_rates(k_p_P31_to_O16_O16_derived)*Y(P31)*Y(H1)*state.rho) + + (-screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*Y(H1)*state.rho + screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*Y(N14)*state.rho) + + (-screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*Y(H1)*state.rho + screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*Y(N15)*state.rho) + + (screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*Y(H1)*state.rho) + + (-screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*Y(H1)*state.rho + screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*Y(O16)*state.rho) + + (screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*Y(He4)*state.rho + -screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*Y(H1)*state.rho) + + (screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*Y(Ne20)*state.rho + -screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*Y(H1)*state.rho) + + (screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*Y(Na22)*state.rho + -screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*Y(H1)*state.rho) + + (-screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*Y(Ne20)*state.rho) + + (screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*Y(He4)*state.rho + -screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*Y(H1)*state.rho) + + (-screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + (screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*Y(P30)*state.rho + -screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*Y(H1)*state.rho) + + (-screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*Y(H1)*state.rho + screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*Y(He4)*state.rho + -screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*Y(H1)*state.rho) + + (-screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*Y(H1)*state.rho + screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*Y(S32)*state.rho) + + (screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*Y(K38)*state.rho + -screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*Y(H1)*state.rho) + + (-screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*Y(H1)*state.rho + screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*Y(He4)*state.rho) + + (screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*Y(Sc42)*state.rho + -screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*Y(H1)*state.rho) + + (-screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*Y(H1)*state.rho + screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*Y(He4)*state.rho) + + (screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*Y(V46)*state.rho + -screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*Y(H1)*state.rho) + + (screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*Y(He4)*state.rho + -screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*Y(H1)*state.rho) + + (screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (-screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(Mn52)*Y(H1)*state.rho + screened_rates(k_Fe53_to_p_Mn52_derived)*Y(Fe53)) + + (-screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(Fe54)*Y(H1)*state.rho + screened_rates(k_Co55_to_p_Fe54_derived)*Y(Co55)) + + (-screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(Fe55)*Y(H1)*state.rho + screened_rates(k_Co56_to_p_Fe55_derived)*Y(Co56)) + + (-screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(Fe56)*Y(H1)*state.rho + screened_rates(k_Co57_to_p_Fe56_derived)*Y(Co57)) + + (-screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(Co56)*Y(H1)*state.rho + screened_rates(k_Ni57_to_p_Co56_derived)*Y(Ni57)) + + (-screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_Ni58_to_p_Co57_derived)*Y(Ni58)) + + (-screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(Ni58)*Y(H1)*state.rho + screened_rates(k_Cu59_to_p_Ni58_derived)*Y(Cu59)) + + (-screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_Zn60_to_p_Cu59_derived)*Y(Zn60)) + + (screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*Y(Mn50)*state.rho + -screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*Y(H1)*state.rho) + + (screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*Y(Mn52)*state.rho + -screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*Y(N)*state.rho + -screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*Y(H1)*state.rho) + + (screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (-screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*Y(N)*state.rho + -screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*Y(N)*state.rho + -screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (-screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (screened_rates(k_n_to_p_weaktab)*Y(N) + -screened_rates(k_p_to_n_weaktab)*Y(H1)) + + (-screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*Y(H1)*state.rho + screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*Y(Ti44)*state.rho); + + ydot_nuc(He4) = + (-screened_rates(k_He4_C12_to_O16_reaclib)*Y(C12)*Y(He4)*state.rho + screened_rates(k_O16_to_He4_C12_derived)*Y(O16)) + + (-screened_rates(k_He4_C14_to_O18_reaclib)*Y(C14)*Y(He4)*state.rho + screened_rates(k_O18_to_He4_C14_derived)*Y(O18)) + + (-screened_rates(k_He4_N14_to_F18_reaclib)*Y(He4)*Y(N14)*state.rho + screened_rates(k_F18_to_He4_N14_derived)*Y(F18)) + + (-screened_rates(k_He4_N15_to_F19_reaclib)*Y(He4)*Y(N15)*state.rho + screened_rates(k_F19_to_He4_N15_derived)*Y(F19)) + + (-screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(He4)*Y(O16)*state.rho + screened_rates(k_Ne20_to_He4_O16_derived)*Y(Ne20)) + + (-screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(He4)*Y(O17)*state.rho + screened_rates(k_Ne21_to_He4_O17_derived)*Y(Ne21)) + + (-screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(He4)*Y(O18)*state.rho + screened_rates(k_Ne22_to_He4_O18_derived)*Y(Ne22)) + + (-screened_rates(k_He4_F18_to_Na22_reaclib)*Y(F18)*Y(He4)*state.rho + screened_rates(k_Na22_to_He4_F18_derived)*Y(Na22)) + + (-screened_rates(k_He4_F19_to_Na23_reaclib)*Y(F19)*Y(He4)*state.rho + screened_rates(k_Na23_to_He4_F19_derived)*Y(Na23)) + + (-screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(He4)*Y(Ne20)*state.rho + screened_rates(k_Mg24_to_He4_Ne20_derived)*Y(Mg24)) + + (-screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(He4)*Y(Ne21)*state.rho + screened_rates(k_Mg25_to_He4_Ne21_derived)*Y(Mg25)) + + (-screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(He4)*Y(Na22)*state.rho + screened_rates(k_Al26_to_He4_Na22_derived)*Y(Al26)) + + (-screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(He4)*Y(Na23)*state.rho + screened_rates(k_Al27_to_He4_Na23_derived)*Y(Al27)) + + (-screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(He4)*Y(Mg24)*state.rho + screened_rates(k_Si28_to_He4_Mg24_derived)*Y(Si28)) + + (-screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(He4)*Y(Mg25)*state.rho + screened_rates(k_Si29_to_He4_Mg25_derived)*Y(Si29)) + + (-screened_rates(k_He4_Al26_to_P30_reaclib)*Y(Al26)*Y(He4)*state.rho + screened_rates(k_P30_to_He4_Al26_derived)*Y(P30)) + + (-screened_rates(k_He4_Al27_to_P31_reaclib)*Y(Al27)*Y(He4)*state.rho + screened_rates(k_P31_to_He4_Al27_derived)*Y(P31)) + + (-screened_rates(k_He4_Si28_to_S32_reaclib)*Y(He4)*Y(Si28)*state.rho + screened_rates(k_S32_to_He4_Si28_derived)*Y(S32)) + + (-screened_rates(k_He4_Si29_to_S33_reaclib)*Y(He4)*Y(Si29)*state.rho + screened_rates(k_S33_to_He4_Si29_derived)*Y(S33)) + + (-screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(He4)*Y(P30)*state.rho + screened_rates(k_Cl34_to_He4_P30_derived)*Y(Cl34)) + + (-screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(He4)*Y(P31)*state.rho + screened_rates(k_Cl35_to_He4_P31_derived)*Y(Cl35)) + + (-screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(He4)*Y(S32)*state.rho + screened_rates(k_Ar36_to_He4_S32_derived)*Y(Ar36)) + + (-screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(He4)*Y(S33)*state.rho + screened_rates(k_Ar37_to_He4_S33_derived)*Y(Ar37)) + + (-screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(Cl34)*Y(He4)*state.rho + screened_rates(k_K38_to_He4_Cl34_derived)*Y(K38)) + + (-screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(Cl35)*Y(He4)*state.rho + screened_rates(k_K39_to_He4_Cl35_derived)*Y(K39)) + + (-screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(Ar36)*Y(He4)*state.rho + screened_rates(k_Ca40_to_He4_Ar36_derived)*Y(Ca40)) + + (-screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(Ar37)*Y(He4)*state.rho + screened_rates(k_Ca41_to_He4_Ar37_derived)*Y(Ca41)) + + (-screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(He4)*Y(K38)*state.rho + screened_rates(k_Sc42_to_He4_K38_derived)*Y(Sc42)) + + (-screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(He4)*Y(K39)*state.rho + screened_rates(k_Sc43_to_He4_K39_derived)*Y(Sc43)) + + (-screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(Ca40)*Y(He4)*state.rho + screened_rates(k_Ti44_to_He4_Ca40_derived)*Y(Ti44)) + + (-screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(Ca41)*Y(He4)*state.rho + screened_rates(k_Ti45_to_He4_Ca41_derived)*Y(Ti45)) + + (-screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(He4)*Y(Sc42)*state.rho + screened_rates(k_V46_to_He4_Sc42_derived)*Y(V46)) + + (-screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(He4)*Y(Sc43)*state.rho + screened_rates(k_V47_to_He4_Sc43_derived)*Y(V47)) + + (-screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(He4)*Y(Ti44)*state.rho + screened_rates(k_Cr48_to_He4_Ti44_derived)*Y(Cr48)) + + (-screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(He4)*Y(Ti45)*state.rho + screened_rates(k_Cr49_to_He4_Ti45_derived)*Y(Cr49)) + + (-screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(He4)*Y(V46)*state.rho + screened_rates(k_Mn50_to_He4_V46_derived)*Y(Mn50)) + + (-screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(He4)*Y(V47)*state.rho + screened_rates(k_Mn51_to_He4_V47_derived)*Y(Mn51)) + + (-screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_Fe52_to_He4_Cr48_derived)*Y(Fe52)) + + (-screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_Co55_to_He4_Mn51_derived)*Y(Co55)) + + (-screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_Ni56_to_He4_Fe52_derived)*Y(Ni56)) + + (0.5*screened_rates(k_C12_C12_to_He4_Ne20_reaclib)*amrex::Math::powi<2>(Y(C12))*state.rho + -screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(He4)*Y(Ne20)*state.rho) + + (-screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*Y(N13)*state.rho + screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*Y(H1)*state.rho) + + (screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*Y(H1)*state.rho + -screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*Y(He4)*state.rho) + + (screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*Y(O16)*state.rho + -screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*Y(Mg24)*state.rho) + + (0.5*screened_rates(k_O16_O16_to_He4_Si28_reaclib)*amrex::Math::powi<2>(Y(O16))*state.rho + -screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*Y(H1)*state.rho + -screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*Y(N14)*state.rho) + + (screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*Y(H1)*state.rho + -screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*Y(N15)*state.rho) + + (-screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*Y(He4)*state.rho + screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*Y(H1)*state.rho) + + (screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*Y(H1)*state.rho + -screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*Y(O16)*state.rho) + + (-screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*Y(He4)*state.rho + screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*Y(H1)*state.rho) + + (screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*Y(Ne20)*state.rho + -screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*Y(Si28)*state.rho) + + (-screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*Y(Na22)*state.rho + screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*Y(H1)*state.rho) + + (screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*Y(Ne20)*state.rho) + + (-screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*Y(He4)*state.rho + screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*Y(H1)*state.rho) + + (screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + (-screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*Y(P30)*state.rho + screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*Y(H1)*state.rho) + + (screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*Y(Si28)*state.rho) + + (-screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*Y(He4)*state.rho + screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*Y(H1)*state.rho) + + (screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*Y(H1)*state.rho + -screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*Y(S32)*state.rho) + + (-screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*Y(K38)*state.rho + screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*Y(H1)*state.rho) + + (screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*Y(H1)*state.rho + -screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*Y(He4)*state.rho) + + (-screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*Y(Sc42)*state.rho + screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*Y(H1)*state.rho) + + (screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*Y(H1)*state.rho + -screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*Y(He4)*state.rho) + + (-screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*Y(V46)*state.rho + screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*Y(He4)*state.rho + screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (-0.5*screened_rates(k_He4_He4_He4_to_C12_reaclib)*amrex::Math::powi<3>(Y(He4))*amrex::Math::powi<2>(state.rho) + 3.0*screened_rates(k_C12_to_He4_He4_He4_derived)*Y(C12)) + + (-screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(He4)*Y(Mn52)*state.rho + screened_rates(k_Co56_to_He4_Mn52_derived)*Y(Co56)) + + (-screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_Ni57_to_He4_Fe53_derived)*Y(Ni57)) + + (-screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(Fe54)*Y(He4)*state.rho + screened_rates(k_Ni58_to_He4_Fe54_derived)*Y(Ni58)) + + (-screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_Cu59_to_He4_Co55_derived)*Y(Cu59)) + + (-screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(He4)*Y(Ni56)*state.rho + screened_rates(k_Zn60_to_He4_Ni56_derived)*Y(Zn60)) + + (-screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*Y(Mn50)*state.rho + screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*Y(Mn52)*state.rho + screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*Y(Mn52)*state.rho) + + (-screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*Y(N)*state.rho + -screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*Y(N)*state.rho + -screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*Y(N)*state.rho + -screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*Y(N)*state.rho + -screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*Y(N)*state.rho + -screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*Y(Ni57)*state.rho) + + (screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*Y(H1)*state.rho + -screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*Y(Ti44)*state.rho); + + ydot_nuc(C12) = + (-screened_rates(k_p_C12_to_N13_reaclib)*Y(C12)*Y(H1)*state.rho + screened_rates(k_N13_to_p_C12_derived)*Y(N13)) + + (-screened_rates(k_He4_C12_to_O16_reaclib)*Y(C12)*Y(He4)*state.rho + screened_rates(k_O16_to_He4_C12_derived)*Y(O16)) + + (-screened_rates(k_C12_C12_to_p_Na23_reaclib)*amrex::Math::powi<2>(Y(C12))*state.rho + 2.0*screened_rates(k_p_Na23_to_C12_C12_derived)*Y(Na23)*Y(H1)*state.rho) + + (-screened_rates(k_C12_C12_to_He4_Ne20_reaclib)*amrex::Math::powi<2>(Y(C12))*state.rho + 2.0*screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(He4)*Y(Ne20)*state.rho) + + (screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*Y(H1)*state.rho + -screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*Y(He4)*state.rho) + + (-screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*Y(O16)*state.rho + screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*Y(H1)*state.rho) + + (-screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*Y(O16)*state.rho + screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*Y(Mg24)*state.rho) + + (-screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*Y(Ne20)*state.rho + screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*Y(H1)*state.rho) + + (-screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*Y(Ne20)*state.rho + screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*Y(Si28)*state.rho) + + (0.16666666666666667*screened_rates(k_He4_He4_He4_to_C12_reaclib)*amrex::Math::powi<3>(Y(He4))*amrex::Math::powi<2>(state.rho) + -screened_rates(k_C12_to_He4_He4_He4_derived)*Y(C12)); + + ydot_nuc(C13) = + screened_rates(k_N13_to_C13_reaclib)*Y(N13) + + (-screened_rates(k_p_C13_to_N14_reaclib)*Y(C13)*Y(H1)*state.rho + screened_rates(k_N14_to_p_C13_derived)*Y(N14)); + + ydot_nuc(C14) = + -screened_rates(k_C14_to_N14_reaclib)*Y(C14) + + (-screened_rates(k_p_C14_to_N15_reaclib)*Y(C14)*Y(H1)*state.rho + screened_rates(k_N15_to_p_C14_derived)*Y(N15)) + + (-screened_rates(k_He4_C14_to_O18_reaclib)*Y(C14)*Y(He4)*state.rho + screened_rates(k_O18_to_He4_C14_derived)*Y(O18)); + + ydot_nuc(N13) = + -screened_rates(k_N13_to_C13_reaclib)*Y(N13) + + (screened_rates(k_p_C12_to_N13_reaclib)*Y(C12)*Y(H1)*state.rho + -screened_rates(k_N13_to_p_C12_derived)*Y(N13)) + + (-screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*Y(N13)*state.rho + screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*Y(H1)*state.rho); + + ydot_nuc(N14) = + screened_rates(k_C14_to_N14_reaclib)*Y(C14) + + (screened_rates(k_p_C13_to_N14_reaclib)*Y(C13)*Y(H1)*state.rho + -screened_rates(k_N14_to_p_C13_derived)*Y(N14)) + + (-screened_rates(k_He4_N14_to_F18_reaclib)*Y(He4)*Y(N14)*state.rho + screened_rates(k_F18_to_He4_N14_derived)*Y(F18)) + + (screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*Y(H1)*state.rho + -screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*Y(N14)*state.rho); + + ydot_nuc(N15) = + (screened_rates(k_p_C14_to_N15_reaclib)*Y(C14)*Y(H1)*state.rho + -screened_rates(k_N15_to_p_C14_derived)*Y(N15)) + + (-screened_rates(k_p_N15_to_O16_reaclib)*Y(N15)*Y(H1)*state.rho + screened_rates(k_O16_to_p_N15_derived)*Y(O16)) + + (-screened_rates(k_He4_N15_to_F19_reaclib)*Y(He4)*Y(N15)*state.rho + screened_rates(k_F19_to_He4_N15_derived)*Y(F19)) + + (-screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*Y(H1)*state.rho + screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*Y(He4)*state.rho) + + (screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*Y(H1)*state.rho + -screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*Y(N15)*state.rho); + + ydot_nuc(O16) = + (screened_rates(k_He4_C12_to_O16_reaclib)*Y(C12)*Y(He4)*state.rho + -screened_rates(k_O16_to_He4_C12_derived)*Y(O16)) + + (screened_rates(k_p_N15_to_O16_reaclib)*Y(N15)*Y(H1)*state.rho + -screened_rates(k_O16_to_p_N15_derived)*Y(O16)) + + (-screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(He4)*Y(O16)*state.rho + screened_rates(k_Ne20_to_He4_O16_derived)*Y(Ne20)) + + (screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*Y(N13)*state.rho + -screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*Y(H1)*state.rho) + + (-screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*Y(O16)*state.rho + screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*Y(H1)*state.rho) + + (-screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*Y(O16)*state.rho + screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*Y(Mg24)*state.rho) + + (-screened_rates(k_O16_O16_to_p_P31_reaclib)*amrex::Math::powi<2>(Y(O16))*state.rho + 2.0*screened_rates(k_p_P31_to_O16_O16_derived)*Y(P31)*Y(H1)*state.rho) + + (-screened_rates(k_O16_O16_to_He4_Si28_reaclib)*amrex::Math::powi<2>(Y(O16))*state.rho + 2.0*screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*Y(H1)*state.rho + -screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*Y(O16)*state.rho); + + ydot_nuc(O17) = + (-screened_rates(k_p_O17_to_F18_reaclib)*Y(O17)*Y(H1)*state.rho + screened_rates(k_F18_to_p_O17_derived)*Y(F18)) + + (-screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(He4)*Y(O17)*state.rho + screened_rates(k_Ne21_to_He4_O17_derived)*Y(Ne21)) + + (-screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*Y(H1)*state.rho + screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*Y(N14)*state.rho); + + ydot_nuc(O18) = + (screened_rates(k_He4_C14_to_O18_reaclib)*Y(C14)*Y(He4)*state.rho + -screened_rates(k_O18_to_He4_C14_derived)*Y(O18)) + + (-screened_rates(k_p_O18_to_F19_reaclib)*Y(O18)*Y(H1)*state.rho + screened_rates(k_F19_to_p_O18_derived)*Y(F19)) + + (-screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(He4)*Y(O18)*state.rho + screened_rates(k_Ne22_to_He4_O18_derived)*Y(Ne22)) + + (-screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*Y(H1)*state.rho + screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*Y(N15)*state.rho) + + (screened_rates(k_F18_to_O18_weaktab)*Y(F18) + -screened_rates(k_O18_to_F18_weaktab)*Y(O18)); + + ydot_nuc(F18) = + (screened_rates(k_He4_N14_to_F18_reaclib)*Y(He4)*Y(N14)*state.rho + -screened_rates(k_F18_to_He4_N14_derived)*Y(F18)) + + (screened_rates(k_p_O17_to_F18_reaclib)*Y(O17)*Y(H1)*state.rho + -screened_rates(k_F18_to_p_O17_derived)*Y(F18)) + + (-screened_rates(k_He4_F18_to_Na22_reaclib)*Y(F18)*Y(He4)*state.rho + screened_rates(k_Na22_to_He4_F18_derived)*Y(Na22)) + + (-screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*Y(He4)*state.rho + screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*Y(H1)*state.rho) + + (-screened_rates(k_F18_to_O18_weaktab)*Y(F18) + screened_rates(k_O18_to_F18_weaktab)*Y(O18)); + + ydot_nuc(F19) = + (screened_rates(k_He4_N15_to_F19_reaclib)*Y(He4)*Y(N15)*state.rho + -screened_rates(k_F19_to_He4_N15_derived)*Y(F19)) + + (screened_rates(k_p_O18_to_F19_reaclib)*Y(O18)*Y(H1)*state.rho + -screened_rates(k_F19_to_p_O18_derived)*Y(F19)) + + (-screened_rates(k_p_F19_to_Ne20_reaclib)*Y(F19)*Y(H1)*state.rho + screened_rates(k_Ne20_to_p_F19_derived)*Y(Ne20)) + + (-screened_rates(k_He4_F19_to_Na23_reaclib)*Y(F19)*Y(He4)*state.rho + screened_rates(k_Na23_to_He4_F19_derived)*Y(Na23)) + + (-screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*Y(H1)*state.rho + screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*Y(O16)*state.rho) + + (-screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*Y(He4)*state.rho + screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*Y(H1)*state.rho); + + ydot_nuc(Ne20) = + (screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(He4)*Y(O16)*state.rho + -screened_rates(k_Ne20_to_He4_O16_derived)*Y(Ne20)) + + (screened_rates(k_p_F19_to_Ne20_reaclib)*Y(F19)*Y(H1)*state.rho + -screened_rates(k_Ne20_to_p_F19_derived)*Y(Ne20)) + + (-screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(He4)*Y(Ne20)*state.rho + screened_rates(k_Mg24_to_He4_Ne20_derived)*Y(Mg24)) + + (0.5*screened_rates(k_C12_C12_to_He4_Ne20_reaclib)*amrex::Math::powi<2>(Y(C12))*state.rho + -screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(He4)*Y(Ne20)*state.rho) + + (-screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*Y(Ne20)*state.rho + screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*Y(H1)*state.rho) + + (-screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*Y(Ne20)*state.rho + screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*Y(Ne20)*state.rho); + + ydot_nuc(Ne21) = + (screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(He4)*Y(O17)*state.rho + -screened_rates(k_Ne21_to_He4_O17_derived)*Y(Ne21)) + + (-screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(Ne21)*Y(H1)*state.rho + screened_rates(k_Na22_to_p_Ne21_derived)*Y(Na22)) + + (-screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(He4)*Y(Ne21)*state.rho + screened_rates(k_Mg25_to_He4_Ne21_derived)*Y(Mg25)) + + (screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*Y(H1)*state.rho); + + ydot_nuc(Ne22) = + (screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(He4)*Y(O18)*state.rho + -screened_rates(k_Ne22_to_He4_O18_derived)*Y(Ne22)) + + (-screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(Ne22)*Y(H1)*state.rho + screened_rates(k_Na23_to_p_Ne22_derived)*Y(Na23)) + + (screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*Y(He4)*state.rho + -screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*Y(H1)*state.rho) + + (screened_rates(k_Na22_to_Ne22_weaktab)*Y(Na22) + -screened_rates(k_Ne22_to_Na22_weaktab)*Y(Ne22)); + + ydot_nuc(Na22) = + (screened_rates(k_He4_F18_to_Na22_reaclib)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_Na22_to_He4_F18_derived)*Y(Na22)) + + (screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(Ne21)*Y(H1)*state.rho + -screened_rates(k_Na22_to_p_Ne21_derived)*Y(Na22)) + + (-screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(He4)*Y(Na22)*state.rho + screened_rates(k_Al26_to_He4_Na22_derived)*Y(Al26)) + + (-screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*Y(Na22)*state.rho + screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*Y(H1)*state.rho) + + (-screened_rates(k_Na22_to_Ne22_weaktab)*Y(Na22) + screened_rates(k_Ne22_to_Na22_weaktab)*Y(Ne22)); + + ydot_nuc(Na23) = + (screened_rates(k_He4_F19_to_Na23_reaclib)*Y(F19)*Y(He4)*state.rho + -screened_rates(k_Na23_to_He4_F19_derived)*Y(Na23)) + + (screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(Ne22)*Y(H1)*state.rho + -screened_rates(k_Na23_to_p_Ne22_derived)*Y(Na23)) + + (-screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_Mg24_to_p_Na23_derived)*Y(Mg24)) + + (-screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(He4)*Y(Na23)*state.rho + screened_rates(k_Al27_to_He4_Na23_derived)*Y(Al27)) + + (0.5*screened_rates(k_C12_C12_to_p_Na23_reaclib)*amrex::Math::powi<2>(Y(C12))*state.rho + -screened_rates(k_p_Na23_to_C12_C12_derived)*Y(Na23)*Y(H1)*state.rho) + + (-screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*Y(Ne20)*state.rho); + + ydot_nuc(Mg24) = + (screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(He4)*Y(Ne20)*state.rho + -screened_rates(k_Mg24_to_He4_Ne20_derived)*Y(Mg24)) + + (screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_Mg24_to_p_Na23_derived)*Y(Mg24)) + + (-screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(He4)*Y(Mg24)*state.rho + screened_rates(k_Si28_to_He4_Mg24_derived)*Y(Si28)) + + (screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*Y(O16)*state.rho + -screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*Y(Mg24)*state.rho) + + (screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*Y(Mg24)*state.rho); + + ydot_nuc(Mg25) = + (screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(He4)*Y(Ne21)*state.rho + -screened_rates(k_Mg25_to_He4_Ne21_derived)*Y(Mg25)) + + (-screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(Mg25)*Y(H1)*state.rho + screened_rates(k_Al26_to_p_Mg25_derived)*Y(Al26)) + + (-screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(He4)*Y(Mg25)*state.rho + screened_rates(k_Si29_to_He4_Mg25_derived)*Y(Si29)) + + (screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*Y(Na22)*state.rho + -screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*Y(H1)*state.rho); + + ydot_nuc(Al26) = + (screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(He4)*Y(Na22)*state.rho + -screened_rates(k_Al26_to_He4_Na22_derived)*Y(Al26)) + + (screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(Mg25)*Y(H1)*state.rho + -screened_rates(k_Al26_to_p_Mg25_derived)*Y(Al26)) + + (-screened_rates(k_He4_Al26_to_P30_reaclib)*Y(Al26)*Y(He4)*state.rho + screened_rates(k_P30_to_He4_Al26_derived)*Y(P30)) + + (-screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*Y(He4)*state.rho + screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*Y(H1)*state.rho); + + ydot_nuc(Al27) = + (screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(He4)*Y(Na23)*state.rho + -screened_rates(k_Al27_to_He4_Na23_derived)*Y(Al27)) + + (-screened_rates(k_p_Al27_to_Si28_reaclib)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_Si28_to_p_Al27_derived)*Y(Si28)) + + (-screened_rates(k_He4_Al27_to_P31_reaclib)*Y(Al27)*Y(He4)*state.rho + screened_rates(k_P31_to_He4_Al27_derived)*Y(P31)) + + (screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*Y(O16)*state.rho + -screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*Y(H1)*state.rho) + + (-screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*Y(Mg24)*state.rho); + + ydot_nuc(Si28) = + (screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(He4)*Y(Mg24)*state.rho + -screened_rates(k_Si28_to_He4_Mg24_derived)*Y(Si28)) + + (screened_rates(k_p_Al27_to_Si28_reaclib)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_Si28_to_p_Al27_derived)*Y(Si28)) + + (-screened_rates(k_He4_Si28_to_S32_reaclib)*Y(He4)*Y(Si28)*state.rho + screened_rates(k_S32_to_He4_Si28_derived)*Y(S32)) + + (0.5*screened_rates(k_O16_O16_to_He4_Si28_reaclib)*amrex::Math::powi<2>(Y(O16))*state.rho + -screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*Y(Ne20)*state.rho + -screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*Y(Si28)*state.rho); + + ydot_nuc(Si29) = + (screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(He4)*Y(Mg25)*state.rho + -screened_rates(k_Si29_to_He4_Mg25_derived)*Y(Si29)) + + (-screened_rates(k_p_Si29_to_P30_reaclib)*Y(Si29)*Y(H1)*state.rho + screened_rates(k_P30_to_p_Si29_derived)*Y(P30)) + + (-screened_rates(k_He4_Si29_to_S33_reaclib)*Y(He4)*Y(Si29)*state.rho + screened_rates(k_S33_to_He4_Si29_derived)*Y(S33)) + + (screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*Y(He4)*state.rho + -screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*Y(H1)*state.rho); + + ydot_nuc(P30) = + (screened_rates(k_He4_Al26_to_P30_reaclib)*Y(Al26)*Y(He4)*state.rho + -screened_rates(k_P30_to_He4_Al26_derived)*Y(P30)) + + (screened_rates(k_p_Si29_to_P30_reaclib)*Y(Si29)*Y(H1)*state.rho + -screened_rates(k_P30_to_p_Si29_derived)*Y(P30)) + + (-screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(He4)*Y(P30)*state.rho + screened_rates(k_Cl34_to_He4_P30_derived)*Y(Cl34)) + + (-screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*Y(P30)*state.rho + screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*Y(H1)*state.rho); + + ydot_nuc(P31) = + (screened_rates(k_He4_Al27_to_P31_reaclib)*Y(Al27)*Y(He4)*state.rho + -screened_rates(k_P31_to_He4_Al27_derived)*Y(P31)) + + (-screened_rates(k_p_P31_to_S32_reaclib)*Y(P31)*Y(H1)*state.rho + screened_rates(k_S32_to_p_P31_derived)*Y(S32)) + + (-screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(He4)*Y(P31)*state.rho + screened_rates(k_Cl35_to_He4_P31_derived)*Y(Cl35)) + + (0.5*screened_rates(k_O16_O16_to_p_P31_reaclib)*amrex::Math::powi<2>(Y(O16))*state.rho + -screened_rates(k_p_P31_to_O16_O16_derived)*Y(P31)*Y(H1)*state.rho) + + (screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*Y(Ne20)*state.rho + -screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*Y(H1)*state.rho) + + (-screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*Y(H1)*state.rho + screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*Y(Si28)*state.rho); + + ydot_nuc(S32) = + (screened_rates(k_He4_Si28_to_S32_reaclib)*Y(He4)*Y(Si28)*state.rho + -screened_rates(k_S32_to_He4_Si28_derived)*Y(S32)) + + (screened_rates(k_p_P31_to_S32_reaclib)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_S32_to_p_P31_derived)*Y(S32)) + + (-screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(He4)*Y(S32)*state.rho + screened_rates(k_Ar36_to_He4_S32_derived)*Y(Ar36)) + + (screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*Y(H1)*state.rho + -screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*Y(S32)*state.rho); + + ydot_nuc(S33) = + (screened_rates(k_He4_Si29_to_S33_reaclib)*Y(He4)*Y(Si29)*state.rho + -screened_rates(k_S33_to_He4_Si29_derived)*Y(S33)) + + (-screened_rates(k_p_S33_to_Cl34_reaclib)*Y(S33)*Y(H1)*state.rho + screened_rates(k_Cl34_to_p_S33_derived)*Y(Cl34)) + + (-screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(He4)*Y(S33)*state.rho + screened_rates(k_Ar37_to_He4_S33_derived)*Y(Ar37)) + + (screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*Y(P30)*state.rho + -screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*Y(H1)*state.rho); + + ydot_nuc(Cl34) = + (screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(He4)*Y(P30)*state.rho + -screened_rates(k_Cl34_to_He4_P30_derived)*Y(Cl34)) + + (screened_rates(k_p_S33_to_Cl34_reaclib)*Y(S33)*Y(H1)*state.rho + -screened_rates(k_Cl34_to_p_S33_derived)*Y(Cl34)) + + (-screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(Cl34)*Y(He4)*state.rho + screened_rates(k_K38_to_He4_Cl34_derived)*Y(K38)) + + (-screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*Y(He4)*state.rho + screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*Y(H1)*state.rho); + + ydot_nuc(Cl35) = + (screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(He4)*Y(P31)*state.rho + -screened_rates(k_Cl35_to_He4_P31_derived)*Y(Cl35)) + + (-screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(Cl35)*Y(H1)*state.rho + screened_rates(k_Ar36_to_p_Cl35_derived)*Y(Ar36)) + + (-screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(Cl35)*Y(He4)*state.rho + screened_rates(k_K39_to_He4_Cl35_derived)*Y(K39)) + + (-screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*Y(H1)*state.rho + screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*Y(S32)*state.rho); + + ydot_nuc(Ar36) = + (screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(He4)*Y(S32)*state.rho + -screened_rates(k_Ar36_to_He4_S32_derived)*Y(Ar36)) + + (screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(Cl35)*Y(H1)*state.rho + -screened_rates(k_Ar36_to_p_Cl35_derived)*Y(Ar36)) + + (-screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(Ar36)*Y(He4)*state.rho + screened_rates(k_Ca40_to_He4_Ar36_derived)*Y(Ca40)) + + (screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*Y(H1)*state.rho + -screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*Y(He4)*state.rho); + + ydot_nuc(Ar37) = + (screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(He4)*Y(S33)*state.rho + -screened_rates(k_Ar37_to_He4_S33_derived)*Y(Ar37)) + + (-screened_rates(k_p_Ar37_to_K38_reaclib)*Y(Ar37)*Y(H1)*state.rho + screened_rates(k_K38_to_p_Ar37_derived)*Y(K38)) + + (-screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(Ar37)*Y(He4)*state.rho + screened_rates(k_Ca41_to_He4_Ar37_derived)*Y(Ca41)) + + (screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*Y(He4)*state.rho + -screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*Y(H1)*state.rho); + + ydot_nuc(K38) = + (screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(Cl34)*Y(He4)*state.rho + -screened_rates(k_K38_to_He4_Cl34_derived)*Y(K38)) + + (screened_rates(k_p_Ar37_to_K38_reaclib)*Y(Ar37)*Y(H1)*state.rho + -screened_rates(k_K38_to_p_Ar37_derived)*Y(K38)) + + (-screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(He4)*Y(K38)*state.rho + screened_rates(k_Sc42_to_He4_K38_derived)*Y(Sc42)) + + (-screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*Y(K38)*state.rho + screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*Y(H1)*state.rho); + + ydot_nuc(K39) = + (screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(Cl35)*Y(He4)*state.rho + -screened_rates(k_K39_to_He4_Cl35_derived)*Y(K39)) + + (-screened_rates(k_p_K39_to_Ca40_reaclib)*Y(K39)*Y(H1)*state.rho + screened_rates(k_Ca40_to_p_K39_derived)*Y(Ca40)) + + (-screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(He4)*Y(K39)*state.rho + screened_rates(k_Sc43_to_He4_K39_derived)*Y(Sc43)) + + (-screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*Y(H1)*state.rho + screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*Y(He4)*state.rho); + + ydot_nuc(Ca40) = + (screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(Ar36)*Y(He4)*state.rho + -screened_rates(k_Ca40_to_He4_Ar36_derived)*Y(Ca40)) + + (screened_rates(k_p_K39_to_Ca40_reaclib)*Y(K39)*Y(H1)*state.rho + -screened_rates(k_Ca40_to_p_K39_derived)*Y(Ca40)) + + (-screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(Ca40)*Y(He4)*state.rho + screened_rates(k_Ti44_to_He4_Ca40_derived)*Y(Ti44)) + + (screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*Y(H1)*state.rho + -screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*Y(He4)*state.rho); + + ydot_nuc(Ca41) = + (screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(Ar37)*Y(He4)*state.rho + -screened_rates(k_Ca41_to_He4_Ar37_derived)*Y(Ca41)) + + (-screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(Ca41)*Y(H1)*state.rho + screened_rates(k_Sc42_to_p_Ca41_derived)*Y(Sc42)) + + (-screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(Ca41)*Y(He4)*state.rho + screened_rates(k_Ti45_to_He4_Ca41_derived)*Y(Ti45)) + + (screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*Y(K38)*state.rho + -screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*Y(H1)*state.rho); + + ydot_nuc(Sc42) = + (screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(He4)*Y(K38)*state.rho + -screened_rates(k_Sc42_to_He4_K38_derived)*Y(Sc42)) + + (screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(Ca41)*Y(H1)*state.rho + -screened_rates(k_Sc42_to_p_Ca41_derived)*Y(Sc42)) + + (-screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(He4)*Y(Sc42)*state.rho + screened_rates(k_V46_to_He4_Sc42_derived)*Y(V46)) + + (-screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*Y(Sc42)*state.rho + screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*Y(H1)*state.rho); + + ydot_nuc(Sc43) = + (screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(He4)*Y(K39)*state.rho + -screened_rates(k_Sc43_to_He4_K39_derived)*Y(Sc43)) + + (-screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(Sc43)*Y(H1)*state.rho + screened_rates(k_Ti44_to_p_Sc43_derived)*Y(Ti44)) + + (-screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(He4)*Y(Sc43)*state.rho + screened_rates(k_V47_to_He4_Sc43_derived)*Y(V47)) + + (-screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*Y(H1)*state.rho + screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*Y(He4)*state.rho); + + ydot_nuc(Ti44) = + (screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(Ca40)*Y(He4)*state.rho + -screened_rates(k_Ti44_to_He4_Ca40_derived)*Y(Ti44)) + + (screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(Sc43)*Y(H1)*state.rho + -screened_rates(k_Ti44_to_p_Sc43_derived)*Y(Ti44)) + + (-screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(He4)*Y(Ti44)*state.rho + screened_rates(k_Cr48_to_He4_Ti44_derived)*Y(Cr48)) + + (screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*Y(H1)*state.rho + -screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*Y(Ti44)*state.rho); + + ydot_nuc(Ti45) = + (screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(Ca41)*Y(He4)*state.rho + -screened_rates(k_Ti45_to_He4_Ca41_derived)*Y(Ti45)) + + (-screened_rates(k_p_Ti45_to_V46_reaclib)*Y(Ti45)*Y(H1)*state.rho + screened_rates(k_V46_to_p_Ti45_derived)*Y(V46)) + + (-screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(He4)*Y(Ti45)*state.rho + screened_rates(k_Cr49_to_He4_Ti45_derived)*Y(Cr49)) + + (screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*Y(Sc42)*state.rho + -screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*Y(H1)*state.rho); + + ydot_nuc(V46) = + (screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(He4)*Y(Sc42)*state.rho + -screened_rates(k_V46_to_He4_Sc42_derived)*Y(V46)) + + (screened_rates(k_p_Ti45_to_V46_reaclib)*Y(Ti45)*Y(H1)*state.rho + -screened_rates(k_V46_to_p_Ti45_derived)*Y(V46)) + + (-screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(He4)*Y(V46)*state.rho + screened_rates(k_Mn50_to_He4_V46_derived)*Y(Mn50)) + + (-screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*Y(V46)*state.rho + screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*Y(H1)*state.rho); + + ydot_nuc(V47) = + (screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(He4)*Y(Sc43)*state.rho + -screened_rates(k_V47_to_He4_Sc43_derived)*Y(V47)) + + (-screened_rates(k_p_V47_to_Cr48_reaclib)*Y(V47)*Y(H1)*state.rho + screened_rates(k_Cr48_to_p_V47_derived)*Y(Cr48)) + + (-screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(He4)*Y(V47)*state.rho + screened_rates(k_Mn51_to_He4_V47_derived)*Y(Mn51)) + + (-screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*Y(H1)*state.rho + screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*Y(Ti44)*state.rho); + + ydot_nuc(Cr48) = + (screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(He4)*Y(Ti44)*state.rho + -screened_rates(k_Cr48_to_He4_Ti44_derived)*Y(Cr48)) + + (screened_rates(k_p_V47_to_Cr48_reaclib)*Y(V47)*Y(H1)*state.rho + -screened_rates(k_Cr48_to_p_V47_derived)*Y(Cr48)) + + (-screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_Fe52_to_He4_Cr48_derived)*Y(Fe52)) + + (-screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*Y(H1)*state.rho); + + ydot_nuc(Cr49) = + (screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(He4)*Y(Ti45)*state.rho + -screened_rates(k_Cr49_to_He4_Ti45_derived)*Y(Cr49)) + + (-screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(Cr49)*Y(H1)*state.rho + screened_rates(k_Mn50_to_p_Cr49_derived)*Y(Mn50)) + + (screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*Y(V46)*state.rho + -screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*Y(He4)*state.rho + screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*Y(H1)*state.rho); + + ydot_nuc(Mn50) = + (screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(He4)*Y(V46)*state.rho + -screened_rates(k_Mn50_to_He4_V46_derived)*Y(Mn50)) + + (screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(Cr49)*Y(H1)*state.rho + -screened_rates(k_Mn50_to_p_Cr49_derived)*Y(Mn50)) + + (-screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(Mn50)*Y(N)*state.rho + screened_rates(k_Mn51_to_n_Mn50_derived)*Y(Mn51)) + + (-screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*Y(Mn50)*state.rho + screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*Y(H1)*state.rho); + + ydot_nuc(Mn51) = + (screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(He4)*Y(V47)*state.rho + -screened_rates(k_Mn51_to_He4_V47_derived)*Y(Mn51)) + + (-screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(Mn51)*Y(H1)*state.rho + screened_rates(k_Fe52_to_p_Mn51_derived)*Y(Fe52)) + + (-screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_Co55_to_He4_Mn51_derived)*Y(Co55)) + + (screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(Mn50)*Y(N)*state.rho + -screened_rates(k_Mn51_to_n_Mn50_derived)*Y(Mn51)) + + (-screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(Mn51)*Y(N)*state.rho + screened_rates(k_Mn52_to_n_Mn51_derived)*Y(Mn52)) + + (-screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*Y(H1)*state.rho); + + ydot_nuc(Mn52) = + (screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*Y(He4)*state.rho + -screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*Y(H1)*state.rho) + + (screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(Mn51)*Y(N)*state.rho + -screened_rates(k_Mn52_to_n_Mn51_derived)*Y(Mn52)) + + (-screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(Mn52)*Y(H1)*state.rho + screened_rates(k_Fe53_to_p_Mn52_derived)*Y(Fe53)) + + (-screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(He4)*Y(Mn52)*state.rho + screened_rates(k_Co56_to_He4_Mn52_derived)*Y(Co56)) + + (-screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*Y(Mn52)*state.rho + screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*Y(N)*state.rho + -screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*Y(H1)*state.rho) + + (screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*Y(Mn52)*state.rho) + + (screened_rates(k_Fe52_to_Mn52_weaktab)*Y(Fe52) + -screened_rates(k_Mn52_to_Fe52_weaktab)*Y(Mn52)); + + ydot_nuc(Fe52) = + (screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_Fe52_to_He4_Cr48_derived)*Y(Fe52)) + + (screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(Mn51)*Y(H1)*state.rho + -screened_rates(k_Fe52_to_p_Mn51_derived)*Y(Fe52)) + + (-screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_Ni56_to_He4_Fe52_derived)*Y(Ni56)) + + (-screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (-screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_Fe53_to_n_Fe52_derived)*Y(Fe53)) + + (-screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*Y(H1)*state.rho) + + (-screened_rates(k_Fe52_to_Mn52_weaktab)*Y(Fe52) + screened_rates(k_Mn52_to_Fe52_weaktab)*Y(Mn52)); + + ydot_nuc(Fe53) = + (screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(Mn52)*Y(H1)*state.rho + -screened_rates(k_Fe53_to_p_Mn52_derived)*Y(Fe53)) + + (screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(Fe52)*Y(N)*state.rho + -screened_rates(k_Fe53_to_n_Fe52_derived)*Y(Fe53)) + + (-screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(Fe53)*Y(N)*state.rho + screened_rates(k_Fe54_to_n_Fe53_derived)*Y(Fe54)) + + (-screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_Ni57_to_He4_Fe53_derived)*Y(Ni57)) + + (screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*Y(Mn50)*state.rho + -screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*Y(H1)*state.rho) + + (-screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*Y(N)*state.rho + -screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*Y(He4)*state.rho); + + ydot_nuc(Fe54) = + (screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(Fe53)*Y(N)*state.rho + -screened_rates(k_Fe54_to_n_Fe53_derived)*Y(Fe54)) + + (-screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(Fe54)*Y(N)*state.rho + screened_rates(k_Fe55_to_n_Fe54_derived)*Y(Fe55)) + + (-screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(Fe54)*Y(H1)*state.rho + screened_rates(k_Co55_to_p_Fe54_derived)*Y(Co55)) + + (-screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(Fe54)*Y(He4)*state.rho + screened_rates(k_Ni58_to_He4_Fe54_derived)*Y(Ni58)) + + (screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*Y(N)*state.rho + -screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*Y(He4)*state.rho); + + ydot_nuc(Fe55) = + (screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(Fe54)*Y(N)*state.rho + -screened_rates(k_Fe55_to_n_Fe54_derived)*Y(Fe55)) + + (-screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_Fe56_to_n_Fe55_derived)*Y(Fe56)) + + (-screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(Fe55)*Y(H1)*state.rho + screened_rates(k_Co56_to_p_Fe55_derived)*Y(Co56)) + + (screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*Y(Mn52)*state.rho + -screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*Y(N)*state.rho + -screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (screened_rates(k_Co55_to_Fe55_weaktab)*Y(Co55) + -screened_rates(k_Fe55_to_Co55_weaktab)*Y(Fe55)); + + ydot_nuc(Fe56) = + (screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(Fe55)*Y(N)*state.rho + -screened_rates(k_Fe56_to_n_Fe55_derived)*Y(Fe56)) + + (-screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(Fe56)*Y(H1)*state.rho + screened_rates(k_Co57_to_p_Fe56_derived)*Y(Co57)) + + (screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (screened_rates(k_Co56_to_Fe56_weaktab)*Y(Co56) + -screened_rates(k_Fe56_to_Co56_weaktab)*Y(Fe56)); + + ydot_nuc(Co55) = + (screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_Co55_to_He4_Mn51_derived)*Y(Co55)) + + (-screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(Co55)*Y(H1)*state.rho + screened_rates(k_Ni56_to_p_Co55_derived)*Y(Ni56)) + + (screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(Fe54)*Y(H1)*state.rho + -screened_rates(k_Co55_to_p_Fe54_derived)*Y(Co55)) + + (-screened_rates(k_n_Co55_to_Co56_reaclib)*Y(Co55)*Y(N)*state.rho + screened_rates(k_Co56_to_n_Co55_derived)*Y(Co56)) + + (-screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_Cu59_to_He4_Co55_derived)*Y(Cu59)) + + (-screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*Y(N)*state.rho + screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (-screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*Y(N)*state.rho + screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*Y(Mn52)*state.rho) + + (-screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (-screened_rates(k_Co55_to_Fe55_weaktab)*Y(Co55) + screened_rates(k_Fe55_to_Co55_weaktab)*Y(Fe55)); + + ydot_nuc(Co56) = + (screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(He4)*Y(Mn52)*state.rho + -screened_rates(k_Co56_to_He4_Mn52_derived)*Y(Co56)) + + (screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(Fe55)*Y(H1)*state.rho + -screened_rates(k_Co56_to_p_Fe55_derived)*Y(Co56)) + + (screened_rates(k_n_Co55_to_Co56_reaclib)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_Co56_to_n_Co55_derived)*Y(Co56)) + + (-screened_rates(k_n_Co56_to_Co57_reaclib)*Y(Co56)*Y(N)*state.rho + screened_rates(k_Co57_to_n_Co56_derived)*Y(Co57)) + + (-screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(Co56)*Y(H1)*state.rho + screened_rates(k_Ni57_to_p_Co56_derived)*Y(Ni57)) + + (screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*Y(N)*state.rho + screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*Y(N)*state.rho + -screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*Y(N)*state.rho + -screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (-screened_rates(k_Co56_to_Fe56_weaktab)*Y(Co56) + screened_rates(k_Fe56_to_Co56_weaktab)*Y(Fe56)) + + (screened_rates(k_Ni56_to_Co56_weaktab)*Y(Ni56) + -screened_rates(k_Co56_to_Ni56_weaktab)*Y(Co56)); + + ydot_nuc(Co57) = + (screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(Fe56)*Y(H1)*state.rho + -screened_rates(k_Co57_to_p_Fe56_derived)*Y(Co57)) + + (screened_rates(k_n_Co56_to_Co57_reaclib)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_Co57_to_n_Co56_derived)*Y(Co57)) + + (-screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_Ni58_to_p_Co57_derived)*Y(Ni58)) + + (-screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*Y(N)*state.rho + -screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (screened_rates(k_Ni57_to_Co57_weaktab)*Y(Ni57) + -screened_rates(k_Co57_to_Ni57_weaktab)*Y(Co57)); + + ydot_nuc(Ni56) = + (screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_Ni56_to_He4_Fe52_derived)*Y(Ni56)) + + (screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(Co55)*Y(H1)*state.rho + -screened_rates(k_Ni56_to_p_Co55_derived)*Y(Ni56)) + + (-screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(Ni56)*Y(N)*state.rho + screened_rates(k_Ni57_to_n_Ni56_derived)*Y(Ni57)) + + (-screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(He4)*Y(Ni56)*state.rho + screened_rates(k_Zn60_to_He4_Ni56_derived)*Y(Zn60)) + + (-screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*Y(N)*state.rho + screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*Y(N)*state.rho + screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (-screened_rates(k_Ni56_to_Co56_weaktab)*Y(Ni56) + screened_rates(k_Co56_to_Ni56_weaktab)*Y(Co56)); + + ydot_nuc(Ni57) = + (screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_Ni57_to_He4_Fe53_derived)*Y(Ni57)) + + (screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(Co56)*Y(H1)*state.rho + -screened_rates(k_Ni57_to_p_Co56_derived)*Y(Ni57)) + + (screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(Ni56)*Y(N)*state.rho + -screened_rates(k_Ni57_to_n_Ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(Ni57)*Y(N)*state.rho + screened_rates(k_Ni58_to_n_Ni57_derived)*Y(Ni58)) + + (-screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*Y(N)*state.rho + screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (-screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*Y(N)*state.rho + screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*Y(N)*state.rho + -screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*Y(Ni57)*state.rho) + + (-screened_rates(k_Ni57_to_Co57_weaktab)*Y(Ni57) + screened_rates(k_Co57_to_Ni57_weaktab)*Y(Co57)); + + ydot_nuc(Ni58) = + (screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(Fe54)*Y(He4)*state.rho + -screened_rates(k_Ni58_to_He4_Fe54_derived)*Y(Ni58)) + + (screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_Ni58_to_p_Co57_derived)*Y(Ni58)) + + (screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(Ni57)*Y(N)*state.rho + -screened_rates(k_Ni58_to_n_Ni57_derived)*Y(Ni58)) + + (-screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(Ni58)*Y(H1)*state.rho + screened_rates(k_Cu59_to_p_Ni58_derived)*Y(Cu59)) + + (screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (-screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*Y(N)*state.rho + screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*Y(He4)*state.rho); + + ydot_nuc(Cu59) = + (screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_Cu59_to_He4_Co55_derived)*Y(Cu59)) + + (screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(Ni58)*Y(H1)*state.rho + -screened_rates(k_Cu59_to_p_Ni58_derived)*Y(Cu59)) + + (-screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_Zn60_to_p_Cu59_derived)*Y(Zn60)) + + (-screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*Y(N)*state.rho + screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (-screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*Y(Ni56)*state.rho); + + ydot_nuc(Zn60) = + (screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(He4)*Y(Ni56)*state.rho + -screened_rates(k_Zn60_to_He4_Ni56_derived)*Y(Zn60)) + + (screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_Zn60_to_p_Cu59_derived)*Y(Zn60)) + + (-screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*Y(N)*state.rho + screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*Y(Ni57)*state.rho); + +} + + +AMREX_GPU_DEVICE AMREX_INLINE +void actual_rhs (const burn_t& state, amrex::Array1D& ydot) +{ + + // Set molar abundances + amrex::Array1D Y; + for (int i = 1; i <= NumSpec; ++i) { + Y(i) = state.xn[i-1] * aion_inv[i-1]; + } + + // build the rates + + rate_t rate_eval; + + constexpr int do_T_derivatives = 0; + + evaluate_rates(state, Y, rate_eval); + + rhs_nuc(state, ydot, Y, rate_eval.screened_rates); + + // ion binding energy contributions + + amrex::Real enuc; + ener_gener_rate(ydot, enuc); + + // include any weak rate neutrino losses + enuc += rate_eval.enuc_weak; + + // Get the thermal neutrino losses + + amrex::Real sneut{}; +#ifdef NEUTRINOS + constexpr int do_derivatives{0}; + amrex::Real dsneutdt{}, dsneutdd{}, dsnuda{}, dsnudz{}; + + neutrino_cooling(state.T, state.rho, state.abar, state.zbar, + sneut, dsneutdt, dsneutdd, dsnuda, dsnudz); +#endif + + // Append the energy equation (this is erg/g/s) + + ydot(net_ienuc) = enuc - sneut; + +} + + +template +AMREX_GPU_DEVICE AMREX_INLINE +void jac_nuc(const burn_t& state, + MatrixType& jac, + const amrex::Array1D& Y, + const amrex::Array1D& screened_rates) +{ + + amrex::Real scratch; + + scratch = -screened_rates(k_n_Co55_to_Co56_reaclib)*Y(Co55)*state.rho - screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*state.rho - screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*state.rho - screened_rates(k_n_Co56_to_Co57_reaclib)*Y(Co56)*state.rho - screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*state.rho - screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*state.rho - screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(Fe52)*state.rho - screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*state.rho - screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(Fe53)*state.rho - screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(Fe54)*state.rho - screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(Fe55)*state.rho - screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(Mn50)*state.rho - screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(Mn51)*state.rho - screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*state.rho - screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(Ni56)*state.rho - screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*state.rho - screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*state.rho - screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(Ni57)*state.rho - screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*state.rho - screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*state.rho - screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*state.rho - screened_rates(k_n_to_p_weaktab); + jac.set(N, N, scratch); + + scratch = screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*state.rho + screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*state.rho + screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*state.rho + screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*state.rho + screened_rates(k_p_to_n_weaktab); + jac.set(N, H1, scratch); + + scratch = screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*state.rho + screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*state.rho + screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*state.rho + screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*state.rho + screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(Mn52)*state.rho + screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(Ni57)*state.rho; + jac.set(N, He4, scratch); + + jac.set(N, C12, 0.0); + + jac.set(N, C13, 0.0); + + jac.set(N, C14, 0.0); + + jac.set(N, N13, 0.0); + + jac.set(N, N14, 0.0); + + jac.set(N, N15, 0.0); + + jac.set(N, O16, 0.0); + + jac.set(N, O17, 0.0); + + jac.set(N, O18, 0.0); + + jac.set(N, F18, 0.0); + + jac.set(N, F19, 0.0); + + jac.set(N, Ne20, 0.0); + + jac.set(N, Ne21, 0.0); + + jac.set(N, Ne22, 0.0); + + jac.set(N, Na22, 0.0); + + jac.set(N, Na23, 0.0); + + jac.set(N, Mg24, 0.0); + + jac.set(N, Mg25, 0.0); + + jac.set(N, Al26, 0.0); + + jac.set(N, Al27, 0.0); + + jac.set(N, Si28, 0.0); + + jac.set(N, Si29, 0.0); + + jac.set(N, P30, 0.0); + + jac.set(N, P31, 0.0); + + jac.set(N, S32, 0.0); + + jac.set(N, S33, 0.0); + + jac.set(N, Cl34, 0.0); + + jac.set(N, Cl35, 0.0); + + jac.set(N, Ar36, 0.0); + + jac.set(N, Ar37, 0.0); + + jac.set(N, K38, 0.0); + + jac.set(N, K39, 0.0); + + jac.set(N, Ca40, 0.0); + + jac.set(N, Ca41, 0.0); + + jac.set(N, Sc42, 0.0); + + jac.set(N, Sc43, 0.0); + + jac.set(N, Ti44, 0.0); + + jac.set(N, Ti45, 0.0); + + jac.set(N, V46, 0.0); + + jac.set(N, V47, 0.0); + + jac.set(N, Cr48, 0.0); + + jac.set(N, Cr49, 0.0); + + scratch = -screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(N)*state.rho; + jac.set(N, Mn50, scratch); + + scratch = screened_rates(k_Mn51_to_n_Mn50_derived) - screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(N)*state.rho; + jac.set(N, Mn51, scratch); + + scratch = screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*state.rho + screened_rates(k_Mn52_to_n_Mn51_derived) + screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(H1)*state.rho; + jac.set(N, Mn52, scratch); + + scratch = -screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(N)*state.rho - screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(N)*state.rho; + jac.set(N, Fe52, scratch); + + scratch = screened_rates(k_Fe53_to_n_Fe52_derived) + screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(He4)*state.rho - screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(N)*state.rho; + jac.set(N, Fe53, scratch); + + scratch = screened_rates(k_Fe54_to_n_Fe53_derived) + screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(He4)*state.rho - screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(N)*state.rho; + jac.set(N, Fe54, scratch); + + scratch = screened_rates(k_Fe55_to_n_Fe54_derived) + screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(He4)*state.rho - screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(N)*state.rho + screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(H1)*state.rho; + jac.set(N, Fe55, scratch); + + scratch = screened_rates(k_Fe56_to_n_Fe55_derived) + screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(H1)*state.rho; + jac.set(N, Fe56, scratch); + + scratch = -screened_rates(k_n_Co55_to_Co56_reaclib)*Y(N)*state.rho - screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(N)*state.rho - screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(N)*state.rho; + jac.set(N, Co55, scratch); + + scratch = screened_rates(k_Co56_to_n_Co55_derived) + screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(He4)*state.rho - screened_rates(k_n_Co56_to_Co57_reaclib)*Y(N)*state.rho - screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(N)*state.rho + screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(H1)*state.rho; + jac.set(N, Co56, scratch); + + scratch = screened_rates(k_Co57_to_n_Co56_derived) + screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(H1)*state.rho; + jac.set(N, Co57, scratch); + + scratch = -screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(N)*state.rho; + jac.set(N, Ni56, scratch); + + scratch = screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*state.rho + screened_rates(k_Ni57_to_n_Ni56_derived) - screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(N)*state.rho; + jac.set(N, Ni57, scratch); + + scratch = screened_rates(k_Ni58_to_n_Ni57_derived) - screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(N)*state.rho; + jac.set(N, Ni58, scratch); + + scratch = -screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(N)*state.rho; + jac.set(N, Cu59, scratch); + + scratch = -screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(N)*state.rho; + jac.set(N, Zn60, scratch); + + scratch = screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*state.rho + screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*state.rho + screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*state.rho + screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*state.rho + screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*state.rho + screened_rates(k_n_to_p_weaktab); + jac.set(H1, N, scratch); + + scratch = -screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*state.rho - screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*state.rho - screened_rates(k_p_Al27_to_Si28_reaclib)*Y(Al27)*state.rho - screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*state.rho - screened_rates(k_p_Ar37_to_K38_reaclib)*Y(Ar37)*state.rho - screened_rates(k_p_C12_to_N13_reaclib)*Y(C12)*state.rho - screened_rates(k_p_C13_to_N14_reaclib)*Y(C13)*state.rho - screened_rates(k_p_C14_to_N15_reaclib)*Y(C14)*state.rho - screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*state.rho - screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(Ca41)*state.rho - screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(Cl35)*state.rho - screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*state.rho - screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*state.rho - screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(Co55)*state.rho - screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*state.rho - screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(Co56)*state.rho - screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*state.rho - screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*state.rho - screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(Co57)*state.rho - screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*state.rho - screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*state.rho - screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(Cr49)*state.rho - screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*state.rho - screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(Cu59)*state.rho - screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*state.rho - screened_rates(k_p_F19_to_Ne20_reaclib)*Y(F19)*state.rho - screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*state.rho - screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(Fe54)*state.rho - screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*state.rho - screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(Fe55)*state.rho - screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*state.rho - screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*state.rho - screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(Fe56)*state.rho - screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*state.rho - screened_rates(k_p_K39_to_Ca40_reaclib)*Y(K39)*state.rho - screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*state.rho - screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(Mg25)*state.rho - screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*state.rho - screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(Mn51)*state.rho - screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*state.rho - screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(Mn52)*state.rho - screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*state.rho - screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*state.rho - screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*state.rho - screened_rates(k_p_N15_to_O16_reaclib)*Y(N15)*state.rho - screened_rates(k_p_Na23_to_C12_C12_derived)*Y(Na23)*state.rho - screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*state.rho - screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(Na23)*state.rho - screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*state.rho - screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(Ne21)*state.rho - screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*state.rho - screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(Ne22)*state.rho - screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(Ni58)*state.rho - screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*state.rho - screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*state.rho - screened_rates(k_p_O17_to_F18_reaclib)*Y(O17)*state.rho - screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*state.rho - screened_rates(k_p_O18_to_F19_reaclib)*Y(O18)*state.rho - screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*state.rho - screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*state.rho - screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*state.rho - screened_rates(k_p_P31_to_O16_O16_derived)*Y(P31)*state.rho - screened_rates(k_p_P31_to_S32_reaclib)*Y(P31)*state.rho - screened_rates(k_p_S33_to_Cl34_reaclib)*Y(S33)*state.rho - screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*state.rho - screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*state.rho - screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(Sc43)*state.rho - screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*state.rho - screened_rates(k_p_Si29_to_P30_reaclib)*Y(Si29)*state.rho - screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*state.rho - screened_rates(k_p_Ti45_to_V46_reaclib)*Y(Ti45)*state.rho - screened_rates(k_p_V47_to_Cr48_reaclib)*Y(V47)*state.rho - screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*state.rho - screened_rates(k_p_to_n_weaktab); + jac.set(H1, H1, scratch); + + scratch = screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*state.rho + screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*state.rho + screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*state.rho + screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*state.rho + screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*state.rho + screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*state.rho + screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*state.rho + screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*state.rho + screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*state.rho + screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*state.rho + screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*state.rho + screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*state.rho + screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*state.rho + screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(K38)*state.rho + screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(Mg24)*state.rho + screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(Mn50)*state.rho + screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(Mn51)*state.rho + screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(Mn52)*state.rho + screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(N13)*state.rho + screened_rates(k_He4_N14_to_p_O17_derived)*Y(N14)*state.rho + screened_rates(k_He4_N15_to_p_O18_derived)*Y(N15)*state.rho + screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(Na22)*state.rho + screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(Ne20)*state.rho + screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(Ni56)*state.rho + screened_rates(k_He4_O16_to_p_F19_derived)*Y(O16)*state.rho + screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(P30)*state.rho + screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(S32)*state.rho + screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(Sc42)*state.rho + screened_rates(k_He4_Si28_to_p_P31_derived)*Y(Si28)*state.rho + screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(Ti44)*state.rho + screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(V46)*state.rho; + jac.set(H1, He4, scratch); + + scratch = 1.0*screened_rates(k_C12_C12_to_p_Na23_reaclib)*Y(C12)*state.rho + screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(Ne20)*state.rho + screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(O16)*state.rho + screened_rates(k_He4_C12_to_p_N15_derived)*Y(He4)*state.rho - screened_rates(k_p_C12_to_N13_reaclib)*Y(H1)*state.rho; + jac.set(H1, C12, scratch); + + scratch = -screened_rates(k_p_C13_to_N14_reaclib)*Y(H1)*state.rho; + jac.set(H1, C13, scratch); + + scratch = -screened_rates(k_p_C14_to_N15_reaclib)*Y(H1)*state.rho; + jac.set(H1, C14, scratch); + + scratch = screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*state.rho + screened_rates(k_N13_to_p_C12_derived); + jac.set(H1, N13, scratch); + + scratch = screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*state.rho + screened_rates(k_N14_to_p_C13_derived); + jac.set(H1, N14, scratch); + + scratch = screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*state.rho + screened_rates(k_N15_to_p_C14_derived) - screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(H1)*state.rho - screened_rates(k_p_N15_to_O16_reaclib)*Y(H1)*state.rho; + jac.set(H1, N15, scratch); + + scratch = screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*state.rho + screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*state.rho + 1.0*screened_rates(k_O16_O16_to_p_P31_reaclib)*Y(O16)*state.rho + screened_rates(k_O16_to_p_N15_derived) - screened_rates(k_p_O16_to_He4_N13_derived)*Y(H1)*state.rho; + jac.set(H1, O16, scratch); + + scratch = -screened_rates(k_p_O17_to_F18_reaclib)*Y(H1)*state.rho - screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(H1)*state.rho; + jac.set(H1, O17, scratch); + + scratch = -screened_rates(k_p_O18_to_F19_reaclib)*Y(H1)*state.rho - screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(H1)*state.rho; + jac.set(H1, O18, scratch); + + scratch = screened_rates(k_F18_to_p_O17_derived) + screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(He4)*state.rho; + jac.set(H1, F18, scratch); + + scratch = screened_rates(k_F19_to_p_O18_derived) + screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(He4)*state.rho - screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(H1)*state.rho - screened_rates(k_p_F19_to_Ne20_reaclib)*Y(H1)*state.rho; + jac.set(H1, F19, scratch); + + scratch = screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*state.rho + screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*state.rho + screened_rates(k_Ne20_to_p_F19_derived); + jac.set(H1, Ne20, scratch); + + scratch = -screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(H1)*state.rho - screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(H1)*state.rho; + jac.set(H1, Ne21, scratch); + + scratch = -screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(H1)*state.rho - screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(H1)*state.rho; + jac.set(H1, Ne22, scratch); + + scratch = screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*state.rho + screened_rates(k_Na22_to_p_Ne21_derived); + jac.set(H1, Na22, scratch); + + scratch = screened_rates(k_Na23_to_p_Ne22_derived) - screened_rates(k_p_Na23_to_C12_C12_derived)*Y(H1)*state.rho - screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(H1)*state.rho; + jac.set(H1, Na23, scratch); + + scratch = screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*state.rho + screened_rates(k_Mg24_to_p_Na23_derived); + jac.set(H1, Mg24, scratch); + + scratch = -screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(H1)*state.rho; + jac.set(H1, Mg25, scratch); + + scratch = screened_rates(k_Al26_to_p_Mg25_derived) + screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(He4)*state.rho; + jac.set(H1, Al26, scratch); + + scratch = -screened_rates(k_p_Al27_to_C12_O16_derived)*Y(H1)*state.rho - screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Al27_to_Si28_reaclib)*Y(H1)*state.rho; + jac.set(H1, Al27, scratch); + + scratch = screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*state.rho + screened_rates(k_Si28_to_p_Al27_derived); + jac.set(H1, Si28, scratch); + + scratch = -screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(H1)*state.rho - screened_rates(k_p_Si29_to_P30_reaclib)*Y(H1)*state.rho; + jac.set(H1, Si29, scratch); + + scratch = screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*state.rho + screened_rates(k_P30_to_p_Si29_derived); + jac.set(H1, P30, scratch); + + scratch = -screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(H1)*state.rho - screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(H1)*state.rho - screened_rates(k_p_P31_to_O16_O16_derived)*Y(H1)*state.rho - screened_rates(k_p_P31_to_S32_reaclib)*Y(H1)*state.rho; + jac.set(H1, P31, scratch); + + scratch = screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*state.rho + screened_rates(k_S32_to_p_P31_derived); + jac.set(H1, S32, scratch); + + scratch = -screened_rates(k_p_S33_to_Cl34_reaclib)*Y(H1)*state.rho - screened_rates(k_p_S33_to_He4_P30_derived)*Y(H1)*state.rho; + jac.set(H1, S33, scratch); + + scratch = screened_rates(k_Cl34_to_p_S33_derived) + screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(He4)*state.rho; + jac.set(H1, Cl34, scratch); + + scratch = -screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(H1)*state.rho; + jac.set(H1, Cl35, scratch); + + scratch = screened_rates(k_Ar36_to_p_Cl35_derived) + screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(He4)*state.rho; + jac.set(H1, Ar36, scratch); + + scratch = -screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(H1)*state.rho - screened_rates(k_p_Ar37_to_K38_reaclib)*Y(H1)*state.rho; + jac.set(H1, Ar37, scratch); + + scratch = screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*state.rho + screened_rates(k_K38_to_p_Ar37_derived); + jac.set(H1, K38, scratch); + + scratch = -screened_rates(k_p_K39_to_Ca40_reaclib)*Y(H1)*state.rho - screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(H1)*state.rho; + jac.set(H1, K39, scratch); + + scratch = screened_rates(k_Ca40_to_p_K39_derived) + screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(He4)*state.rho; + jac.set(H1, Ca40, scratch); + + scratch = -screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(H1)*state.rho - screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(H1)*state.rho; + jac.set(H1, Ca41, scratch); + + scratch = screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*state.rho + screened_rates(k_Sc42_to_p_Ca41_derived); + jac.set(H1, Sc42, scratch); + + scratch = -screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(H1)*state.rho; + jac.set(H1, Sc43, scratch); + + scratch = screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*state.rho + screened_rates(k_Ti44_to_p_Sc43_derived); + jac.set(H1, Ti44, scratch); + + scratch = -screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(H1)*state.rho - screened_rates(k_p_Ti45_to_V46_reaclib)*Y(H1)*state.rho; + jac.set(H1, Ti45, scratch); + + scratch = screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*state.rho + screened_rates(k_V46_to_p_Ti45_derived); + jac.set(H1, V46, scratch); + + scratch = -screened_rates(k_p_V47_to_Cr48_reaclib)*Y(H1)*state.rho - screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(H1)*state.rho; + jac.set(H1, V47, scratch); + + scratch = screened_rates(k_Cr48_to_p_V47_derived) + screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(He4)*state.rho; + jac.set(H1, Cr48, scratch); + + scratch = screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(H1)*state.rho - screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(H1)*state.rho; + jac.set(H1, Cr49, scratch); + + scratch = screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*state.rho + screened_rates(k_Mn50_to_p_Cr49_derived); + jac.set(H1, Mn50, scratch); + + scratch = screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(H1)*state.rho; + jac.set(H1, Mn51, scratch); + + scratch = screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(H1)*state.rho - screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(H1)*state.rho; + jac.set(H1, Mn52, scratch); + + scratch = screened_rates(k_Fe52_to_p_Mn51_derived) + screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(He4)*state.rho + screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(N)*state.rho; + jac.set(H1, Fe52, scratch); + + scratch = screened_rates(k_Fe53_to_p_Mn52_derived) + screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(H1)*state.rho; + jac.set(H1, Fe53, scratch); + + scratch = screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(He4)*state.rho - screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(H1)*state.rho; + jac.set(H1, Fe54, scratch); + + scratch = -screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(H1)*state.rho - screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(H1)*state.rho; + jac.set(H1, Fe55, scratch); + + scratch = -screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(H1)*state.rho; + jac.set(H1, Fe56, scratch); + + scratch = screened_rates(k_Co55_to_p_Fe54_derived) + screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(He4)*state.rho + screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(N)*state.rho - screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(H1)*state.rho - screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(H1)*state.rho; + jac.set(H1, Co55, scratch); + + scratch = screened_rates(k_Co56_to_p_Fe55_derived) + screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(N)*state.rho - screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(H1)*state.rho - screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(H1)*state.rho; + jac.set(H1, Co56, scratch); + + scratch = screened_rates(k_Co57_to_p_Fe56_derived) - screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(H1)*state.rho; + jac.set(H1, Co57, scratch); + + scratch = screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*state.rho + screened_rates(k_Ni56_to_p_Co55_derived) + screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(N)*state.rho; + jac.set(H1, Ni56, scratch); + + scratch = screened_rates(k_Ni57_to_p_Co56_derived) + screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(N)*state.rho; + jac.set(H1, Ni57, scratch); + + scratch = screened_rates(k_Ni58_to_p_Co57_derived) - screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(H1)*state.rho; + jac.set(H1, Ni58, scratch); + + scratch = screened_rates(k_Cu59_to_p_Ni58_derived) - screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(H1)*state.rho; + jac.set(H1, Cu59, scratch); + + scratch = screened_rates(k_Zn60_to_p_Cu59_derived); + jac.set(H1, Zn60, scratch); + + scratch = screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*state.rho + screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*state.rho + screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*state.rho + screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*state.rho + screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*state.rho + screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*state.rho; + jac.set(He4, N, scratch); + + scratch = screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*state.rho + screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*state.rho + screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*state.rho + screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*state.rho + screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*state.rho + screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*state.rho + screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*state.rho + screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*state.rho + screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*state.rho + screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*state.rho + screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*state.rho + screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*state.rho + screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*state.rho + screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*state.rho + screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*state.rho + screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*state.rho + screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*state.rho + screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*state.rho + screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*state.rho + screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*state.rho + screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*state.rho + screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*state.rho + screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*state.rho + screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*state.rho + screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*state.rho + screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*state.rho + screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*state.rho + screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*state.rho + screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*state.rho + screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*state.rho + screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*state.rho; + jac.set(He4, H1, scratch); + + scratch = -screened_rates(k_He4_Al26_to_P30_reaclib)*Y(Al26)*state.rho - screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*state.rho - screened_rates(k_He4_Al27_to_P31_reaclib)*Y(Al27)*state.rho - screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(Ar36)*state.rho - screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*state.rho - screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(Ar37)*state.rho - screened_rates(k_He4_C12_to_O16_reaclib)*Y(C12)*state.rho - screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*state.rho - screened_rates(k_He4_C14_to_O18_reaclib)*Y(C14)*state.rho - screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(Ca40)*state.rho - screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*state.rho - screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(Ca41)*state.rho - screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(Cl34)*state.rho - screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*state.rho - screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(Cl35)*state.rho - screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(Co55)*state.rho - screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*state.rho - screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*state.rho - screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(Cr48)*state.rho - screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*state.rho - screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*state.rho - screened_rates(k_He4_F18_to_Na22_reaclib)*Y(F18)*state.rho - screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*state.rho - screened_rates(k_He4_F19_to_Na23_reaclib)*Y(F19)*state.rho - screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*state.rho - screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(Fe52)*state.rho - screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*state.rho - screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(Fe53)*state.rho - screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*state.rho - screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(Fe54)*state.rho - screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*state.rho - screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*state.rho - 1.5*screened_rates(k_He4_He4_He4_to_C12_reaclib)*amrex::Math::powi<2>(Y(He4))*amrex::Math::powi<2>(state.rho) - screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(K38)*state.rho - screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(K38)*state.rho - screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(K39)*state.rho - screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(Mg24)*state.rho - screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(Mg24)*state.rho - screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(Mg24)*state.rho - screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(Mg25)*state.rho - screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(Mn50)*state.rho - screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(Mn51)*state.rho - screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(Mn51)*state.rho - screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(Mn52)*state.rho - screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(Mn52)*state.rho - screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(Mn52)*state.rho - screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(N13)*state.rho - screened_rates(k_He4_N14_to_F18_reaclib)*Y(N14)*state.rho - screened_rates(k_He4_N14_to_p_O17_derived)*Y(N14)*state.rho - screened_rates(k_He4_N15_to_F19_reaclib)*Y(N15)*state.rho - screened_rates(k_He4_N15_to_p_O18_derived)*Y(N15)*state.rho - screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(Na22)*state.rho - screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(Na22)*state.rho - screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(Na23)*state.rho - screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(Ne20)*state.rho - screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(Ne20)*state.rho - screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(Ne20)*state.rho - screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(Ne21)*state.rho - screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(Ni56)*state.rho - screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(Ni56)*state.rho - screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(Ni57)*state.rho - screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(O16)*state.rho - screened_rates(k_He4_O16_to_p_F19_derived)*Y(O16)*state.rho - screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(O17)*state.rho - screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(O18)*state.rho - screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(P30)*state.rho - screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(P30)*state.rho - screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(P31)*state.rho - screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(S32)*state.rho - screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(S32)*state.rho - screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(S33)*state.rho - screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(Sc42)*state.rho - screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(Sc42)*state.rho - screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(Sc43)*state.rho - screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(Si28)*state.rho - screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(Si28)*state.rho - screened_rates(k_He4_Si28_to_S32_reaclib)*Y(Si28)*state.rho - screened_rates(k_He4_Si28_to_p_P31_derived)*Y(Si28)*state.rho - screened_rates(k_He4_Si29_to_S33_reaclib)*Y(Si29)*state.rho - screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(Ti44)*state.rho - screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(Ti44)*state.rho - screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(Ti45)*state.rho - screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(V46)*state.rho - screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(V46)*state.rho - screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(V47)*state.rho; + jac.set(He4, He4, scratch); + + scratch = 1.0*screened_rates(k_C12_C12_to_He4_Ne20_reaclib)*Y(C12)*state.rho + screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(Ne20)*state.rho + screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(O16)*state.rho + 3.0*screened_rates(k_C12_to_He4_He4_He4_derived) - screened_rates(k_He4_C12_to_O16_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_C12_to_p_N15_derived)*Y(He4)*state.rho; + jac.set(He4, C12, scratch); + + jac.set(He4, C13, 0.0); + + scratch = -screened_rates(k_He4_C14_to_O18_reaclib)*Y(He4)*state.rho; + jac.set(He4, C14, scratch); + + scratch = -screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*state.rho; + jac.set(He4, N13, scratch); + + scratch = -screened_rates(k_He4_N14_to_F18_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*state.rho; + jac.set(He4, N14, scratch); + + scratch = -screened_rates(k_He4_N15_to_F19_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*state.rho + screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(H1)*state.rho; + jac.set(He4, N15, scratch); + + scratch = screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*state.rho - screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*state.rho + 1.0*screened_rates(k_O16_O16_to_He4_Si28_reaclib)*Y(O16)*state.rho + screened_rates(k_O16_to_He4_C12_derived) + screened_rates(k_p_O16_to_He4_N13_derived)*Y(H1)*state.rho; + jac.set(He4, O16, scratch); + + scratch = -screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(He4)*state.rho + screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(H1)*state.rho; + jac.set(He4, O17, scratch); + + scratch = -screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(He4)*state.rho + screened_rates(k_O18_to_He4_C14_derived) + screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(H1)*state.rho; + jac.set(He4, O18, scratch); + + scratch = screened_rates(k_F18_to_He4_N14_derived) - screened_rates(k_He4_F18_to_Na22_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(He4)*state.rho; + jac.set(He4, F18, scratch); + + scratch = screened_rates(k_F19_to_He4_N15_derived) - screened_rates(k_He4_F19_to_Na23_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(He4)*state.rho + screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(H1)*state.rho; + jac.set(He4, F19, scratch); + + scratch = screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*state.rho - screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(He4)*state.rho - screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*state.rho + screened_rates(k_Ne20_to_He4_O16_derived); + jac.set(He4, Ne20, scratch); + + scratch = -screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(He4)*state.rho + screened_rates(k_Ne21_to_He4_O17_derived) + screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(H1)*state.rho; + jac.set(He4, Ne21, scratch); + + scratch = screened_rates(k_Ne22_to_He4_O18_derived) + screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(H1)*state.rho; + jac.set(He4, Ne22, scratch); + + scratch = -screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*state.rho + screened_rates(k_Na22_to_He4_F18_derived); + jac.set(He4, Na22, scratch); + + scratch = -screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(He4)*state.rho + screened_rates(k_Na23_to_He4_F19_derived) + screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(H1)*state.rho; + jac.set(He4, Na23, scratch); + + scratch = -screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*state.rho - screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*state.rho + screened_rates(k_Mg24_to_He4_Ne20_derived); + jac.set(He4, Mg24, scratch); + + scratch = -screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(He4)*state.rho + screened_rates(k_Mg25_to_He4_Ne21_derived) + screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(H1)*state.rho; + jac.set(He4, Mg25, scratch); + + scratch = screened_rates(k_Al26_to_He4_Na22_derived) - screened_rates(k_He4_Al26_to_P30_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(He4)*state.rho; + jac.set(He4, Al26, scratch); + + scratch = screened_rates(k_Al27_to_He4_Na23_derived) - screened_rates(k_He4_Al27_to_P31_reaclib)*Y(He4)*state.rho + screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(H1)*state.rho; + jac.set(He4, Al27, scratch); + + scratch = -screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*state.rho - screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(He4)*state.rho - screened_rates(k_He4_Si28_to_S32_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*state.rho + screened_rates(k_Si28_to_He4_Mg24_derived); + jac.set(He4, Si28, scratch); + + scratch = -screened_rates(k_He4_Si29_to_S33_reaclib)*Y(He4)*state.rho + screened_rates(k_Si29_to_He4_Mg25_derived) + screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(H1)*state.rho; + jac.set(He4, Si29, scratch); + + scratch = -screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*state.rho + screened_rates(k_P30_to_He4_Al26_derived); + jac.set(He4, P30, scratch); + + scratch = -screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(He4)*state.rho + screened_rates(k_P31_to_He4_Al27_derived) + screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(H1)*state.rho; + jac.set(He4, P31, scratch); + + scratch = -screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*state.rho + screened_rates(k_S32_to_He4_Si28_derived); + jac.set(He4, S32, scratch); + + scratch = -screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(He4)*state.rho + screened_rates(k_S33_to_He4_Si29_derived) + screened_rates(k_p_S33_to_He4_P30_derived)*Y(H1)*state.rho; + jac.set(He4, S33, scratch); + + scratch = screened_rates(k_Cl34_to_He4_P30_derived) - screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(He4)*state.rho; + jac.set(He4, Cl34, scratch); + + scratch = screened_rates(k_Cl35_to_He4_P31_derived) - screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(He4)*state.rho + screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(H1)*state.rho; + jac.set(He4, Cl35, scratch); + + scratch = screened_rates(k_Ar36_to_He4_S32_derived) - screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(He4)*state.rho; + jac.set(He4, Ar36, scratch); + + scratch = screened_rates(k_Ar37_to_He4_S33_derived) - screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(He4)*state.rho + screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(H1)*state.rho; + jac.set(He4, Ar37, scratch); + + scratch = -screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*state.rho + screened_rates(k_K38_to_He4_Cl34_derived); + jac.set(He4, K38, scratch); + + scratch = -screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(He4)*state.rho + screened_rates(k_K39_to_He4_Cl35_derived) + screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(H1)*state.rho; + jac.set(He4, K39, scratch); + + scratch = screened_rates(k_Ca40_to_He4_Ar36_derived) - screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(He4)*state.rho; + jac.set(He4, Ca40, scratch); + + scratch = screened_rates(k_Ca41_to_He4_Ar37_derived) - screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(He4)*state.rho + screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(H1)*state.rho; + jac.set(He4, Ca41, scratch); + + scratch = -screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*state.rho + screened_rates(k_Sc42_to_He4_K38_derived); + jac.set(He4, Sc42, scratch); + + scratch = -screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(He4)*state.rho + screened_rates(k_Sc43_to_He4_K39_derived) + screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(H1)*state.rho; + jac.set(He4, Sc43, scratch); + + scratch = -screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*state.rho + screened_rates(k_Ti44_to_He4_Ca40_derived); + jac.set(He4, Ti44, scratch); + + scratch = -screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(He4)*state.rho + screened_rates(k_Ti45_to_He4_Ca41_derived) + screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(H1)*state.rho; + jac.set(He4, Ti45, scratch); + + scratch = -screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*state.rho + screened_rates(k_V46_to_He4_Sc42_derived); + jac.set(He4, V46, scratch); + + scratch = -screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(He4)*state.rho + screened_rates(k_V47_to_He4_Sc43_derived) + screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(H1)*state.rho; + jac.set(He4, V47, scratch); + + scratch = screened_rates(k_Cr48_to_He4_Ti44_derived) - screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(He4)*state.rho; + jac.set(He4, Cr48, scratch); + + scratch = screened_rates(k_Cr49_to_He4_Ti45_derived) - screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(He4)*state.rho + screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(H1)*state.rho; + jac.set(He4, Cr49, scratch); + + scratch = -screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*state.rho + screened_rates(k_Mn50_to_He4_V46_derived); + jac.set(He4, Mn50, scratch); + + scratch = -screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*state.rho + screened_rates(k_Mn51_to_He4_V47_derived) + screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(H1)*state.rho; + jac.set(He4, Mn51, scratch); + + scratch = -screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*state.rho - screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*state.rho + screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(H1)*state.rho; + jac.set(He4, Mn52, scratch); + + scratch = screened_rates(k_Fe52_to_He4_Cr48_derived) - screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(He4)*state.rho; + jac.set(He4, Fe52, scratch); + + scratch = -screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(He4)*state.rho - screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(He4)*state.rho + screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(H1)*state.rho; + jac.set(He4, Fe53, scratch); + + scratch = -screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(He4)*state.rho - screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(He4)*state.rho + screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(H1)*state.rho; + jac.set(He4, Fe54, scratch); + + scratch = -screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(He4)*state.rho + screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(H1)*state.rho; + jac.set(He4, Fe55, scratch); + + jac.set(He4, Fe56, 0.0); + + scratch = screened_rates(k_Co55_to_He4_Mn51_derived) - screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(He4)*state.rho + screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(N)*state.rho + screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(H1)*state.rho; + jac.set(He4, Co55, scratch); + + scratch = screened_rates(k_Co56_to_He4_Mn52_derived) - screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(He4)*state.rho + screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(H1)*state.rho; + jac.set(He4, Co56, scratch); + + scratch = screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(H1)*state.rho; + jac.set(He4, Co57, scratch); + + scratch = -screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*state.rho + screened_rates(k_Ni56_to_He4_Fe52_derived) + screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(N)*state.rho; + jac.set(He4, Ni56, scratch); + + scratch = -screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*state.rho + screened_rates(k_Ni57_to_He4_Fe53_derived) + screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(N)*state.rho; + jac.set(He4, Ni57, scratch); + + scratch = screened_rates(k_Ni58_to_He4_Fe54_derived) + screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(N)*state.rho + screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(H1)*state.rho; + jac.set(He4, Ni58, scratch); + + scratch = screened_rates(k_Cu59_to_He4_Co55_derived) + screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(N)*state.rho + screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(H1)*state.rho; + jac.set(He4, Cu59, scratch); + + scratch = screened_rates(k_Zn60_to_He4_Ni56_derived) + screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(N)*state.rho; + jac.set(He4, Zn60, scratch); + + jac.set(C12, N, 0.0); + + scratch = screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*state.rho - screened_rates(k_p_C12_to_N13_reaclib)*Y(C12)*state.rho + screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*state.rho + 2.0*screened_rates(k_p_Na23_to_C12_C12_derived)*Y(Na23)*state.rho + screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*state.rho; + jac.set(C12, H1, scratch); + + scratch = -screened_rates(k_He4_C12_to_O16_reaclib)*Y(C12)*state.rho - screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*state.rho + 0.5*screened_rates(k_He4_He4_He4_to_C12_reaclib)*amrex::Math::powi<2>(Y(He4))*amrex::Math::powi<2>(state.rho) + screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(Mg24)*state.rho + 2.0*screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(Ne20)*state.rho + screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(Si28)*state.rho; + jac.set(C12, He4, scratch); + + scratch = -2.0*screened_rates(k_C12_C12_to_He4_Ne20_reaclib)*Y(C12)*state.rho - 2.0*screened_rates(k_C12_C12_to_p_Na23_reaclib)*Y(C12)*state.rho - screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(Ne20)*state.rho - screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(Ne20)*state.rho - screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(O16)*state.rho - screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(O16)*state.rho - screened_rates(k_C12_to_He4_He4_He4_derived) - screened_rates(k_He4_C12_to_O16_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_C12_to_p_N15_derived)*Y(He4)*state.rho - screened_rates(k_p_C12_to_N13_reaclib)*Y(H1)*state.rho; + jac.set(C12, C12, scratch); + + jac.set(C12, C13, 0.0); + + jac.set(C12, C14, 0.0); + + scratch = screened_rates(k_N13_to_p_C12_derived); + jac.set(C12, N13, scratch); + + jac.set(C12, N14, 0.0); + + scratch = screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(H1)*state.rho; + jac.set(C12, N15, scratch); + + scratch = -screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*state.rho - screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*state.rho + screened_rates(k_O16_to_He4_C12_derived); + jac.set(C12, O16, scratch); + + jac.set(C12, O17, 0.0); + + jac.set(C12, O18, 0.0); + + jac.set(C12, F18, 0.0); + + jac.set(C12, F19, 0.0); + + scratch = -screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*state.rho - screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*state.rho + 2.0*screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(He4)*state.rho; + jac.set(C12, Ne20, scratch); + + jac.set(C12, Ne21, 0.0); + + jac.set(C12, Ne22, 0.0); + + jac.set(C12, Na22, 0.0); + + scratch = 2.0*screened_rates(k_p_Na23_to_C12_C12_derived)*Y(H1)*state.rho; + jac.set(C12, Na23, scratch); + + scratch = screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*state.rho; + jac.set(C12, Mg24, scratch); + + jac.set(C12, Mg25, 0.0); + + jac.set(C12, Al26, 0.0); + + scratch = screened_rates(k_p_Al27_to_C12_O16_derived)*Y(H1)*state.rho; + jac.set(C12, Al27, scratch); + + scratch = screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*state.rho; + jac.set(C12, Si28, scratch); + + jac.set(C12, Si29, 0.0); + + jac.set(C12, P30, 0.0); + + scratch = screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(H1)*state.rho; + jac.set(C12, P31, scratch); + + jac.set(C12, S32, 0.0); + + jac.set(C12, S33, 0.0); + + jac.set(C12, Cl34, 0.0); + + jac.set(C12, Cl35, 0.0); + + jac.set(C12, Ar36, 0.0); + + jac.set(C12, Ar37, 0.0); + + jac.set(C12, K38, 0.0); + + jac.set(C12, K39, 0.0); + + jac.set(C12, Ca40, 0.0); + + jac.set(C12, Ca41, 0.0); + + jac.set(C12, Sc42, 0.0); + + jac.set(C12, Sc43, 0.0); + + jac.set(C12, Ti44, 0.0); + + jac.set(C12, Ti45, 0.0); + + jac.set(C12, V46, 0.0); + + jac.set(C12, V47, 0.0); + + jac.set(C12, Cr48, 0.0); + + jac.set(C12, Cr49, 0.0); + + jac.set(C12, Mn50, 0.0); + + jac.set(C12, Mn51, 0.0); + + jac.set(C12, Mn52, 0.0); + + jac.set(C12, Fe52, 0.0); + + jac.set(C12, Fe53, 0.0); + + jac.set(C12, Fe54, 0.0); + + jac.set(C12, Fe55, 0.0); + + jac.set(C12, Fe56, 0.0); + + jac.set(C12, Co55, 0.0); + + jac.set(C12, Co56, 0.0); + + jac.set(C12, Co57, 0.0); + + jac.set(C12, Ni56, 0.0); + + jac.set(C12, Ni57, 0.0); + + jac.set(C12, Ni58, 0.0); + + jac.set(C12, Cu59, 0.0); + + jac.set(C12, Zn60, 0.0); + + jac.set(C13, N, 0.0); + + scratch = -screened_rates(k_p_C13_to_N14_reaclib)*Y(C13)*state.rho; + jac.set(C13, H1, scratch); + + jac.set(C13, He4, 0.0); + + jac.set(C13, C12, 0.0); + + scratch = -screened_rates(k_p_C13_to_N14_reaclib)*Y(H1)*state.rho; + jac.set(C13, C13, scratch); + + jac.set(C13, C14, 0.0); + + scratch = screened_rates(k_N13_to_C13_reaclib); + jac.set(C13, N13, scratch); + + scratch = screened_rates(k_N14_to_p_C13_derived); + jac.set(C13, N14, scratch); + + jac.set(C13, N15, 0.0); + + jac.set(C13, O16, 0.0); + + jac.set(C13, O17, 0.0); + + jac.set(C13, O18, 0.0); + + jac.set(C13, F18, 0.0); + + jac.set(C13, F19, 0.0); + + jac.set(C13, Ne20, 0.0); + + jac.set(C13, Ne21, 0.0); + + jac.set(C13, Ne22, 0.0); + + jac.set(C13, Na22, 0.0); + + jac.set(C13, Na23, 0.0); + + jac.set(C13, Mg24, 0.0); + + jac.set(C13, Mg25, 0.0); + + jac.set(C13, Al26, 0.0); + + jac.set(C13, Al27, 0.0); + + jac.set(C13, Si28, 0.0); + + jac.set(C13, Si29, 0.0); + + jac.set(C13, P30, 0.0); + + jac.set(C13, P31, 0.0); + + jac.set(C13, S32, 0.0); + + jac.set(C13, S33, 0.0); + + jac.set(C13, Cl34, 0.0); + + jac.set(C13, Cl35, 0.0); + + jac.set(C13, Ar36, 0.0); + + jac.set(C13, Ar37, 0.0); + + jac.set(C13, K38, 0.0); + + jac.set(C13, K39, 0.0); + + jac.set(C13, Ca40, 0.0); + + jac.set(C13, Ca41, 0.0); + + jac.set(C13, Sc42, 0.0); + + jac.set(C13, Sc43, 0.0); + + jac.set(C13, Ti44, 0.0); + + jac.set(C13, Ti45, 0.0); + + jac.set(C13, V46, 0.0); + + jac.set(C13, V47, 0.0); + + jac.set(C13, Cr48, 0.0); + + jac.set(C13, Cr49, 0.0); + + jac.set(C13, Mn50, 0.0); + + jac.set(C13, Mn51, 0.0); + + jac.set(C13, Mn52, 0.0); + + jac.set(C13, Fe52, 0.0); + + jac.set(C13, Fe53, 0.0); + + jac.set(C13, Fe54, 0.0); + + jac.set(C13, Fe55, 0.0); + + jac.set(C13, Fe56, 0.0); + + jac.set(C13, Co55, 0.0); + + jac.set(C13, Co56, 0.0); + + jac.set(C13, Co57, 0.0); + + jac.set(C13, Ni56, 0.0); + + jac.set(C13, Ni57, 0.0); + + jac.set(C13, Ni58, 0.0); + + jac.set(C13, Cu59, 0.0); + + jac.set(C13, Zn60, 0.0); + + jac.set(C14, N, 0.0); + + scratch = -screened_rates(k_p_C14_to_N15_reaclib)*Y(C14)*state.rho; + jac.set(C14, H1, scratch); + + scratch = -screened_rates(k_He4_C14_to_O18_reaclib)*Y(C14)*state.rho; + jac.set(C14, He4, scratch); + + jac.set(C14, C12, 0.0); + + jac.set(C14, C13, 0.0); + + scratch = -screened_rates(k_C14_to_N14_reaclib) - screened_rates(k_He4_C14_to_O18_reaclib)*Y(He4)*state.rho - screened_rates(k_p_C14_to_N15_reaclib)*Y(H1)*state.rho; + jac.set(C14, C14, scratch); + + jac.set(C14, N13, 0.0); + + jac.set(C14, N14, 0.0); + + scratch = screened_rates(k_N15_to_p_C14_derived); + jac.set(C14, N15, scratch); + + jac.set(C14, O16, 0.0); + + jac.set(C14, O17, 0.0); + + scratch = screened_rates(k_O18_to_He4_C14_derived); + jac.set(C14, O18, scratch); + + jac.set(C14, F18, 0.0); + + jac.set(C14, F19, 0.0); + + jac.set(C14, Ne20, 0.0); + + jac.set(C14, Ne21, 0.0); + + jac.set(C14, Ne22, 0.0); + + jac.set(C14, Na22, 0.0); + + jac.set(C14, Na23, 0.0); + + jac.set(C14, Mg24, 0.0); + + jac.set(C14, Mg25, 0.0); + + jac.set(C14, Al26, 0.0); + + jac.set(C14, Al27, 0.0); + + jac.set(C14, Si28, 0.0); + + jac.set(C14, Si29, 0.0); + + jac.set(C14, P30, 0.0); + + jac.set(C14, P31, 0.0); + + jac.set(C14, S32, 0.0); + + jac.set(C14, S33, 0.0); + + jac.set(C14, Cl34, 0.0); + + jac.set(C14, Cl35, 0.0); + + jac.set(C14, Ar36, 0.0); + + jac.set(C14, Ar37, 0.0); + + jac.set(C14, K38, 0.0); + + jac.set(C14, K39, 0.0); + + jac.set(C14, Ca40, 0.0); + + jac.set(C14, Ca41, 0.0); + + jac.set(C14, Sc42, 0.0); + + jac.set(C14, Sc43, 0.0); + + jac.set(C14, Ti44, 0.0); + + jac.set(C14, Ti45, 0.0); + + jac.set(C14, V46, 0.0); + + jac.set(C14, V47, 0.0); + + jac.set(C14, Cr48, 0.0); + + jac.set(C14, Cr49, 0.0); + + jac.set(C14, Mn50, 0.0); + + jac.set(C14, Mn51, 0.0); + + jac.set(C14, Mn52, 0.0); + + jac.set(C14, Fe52, 0.0); + + jac.set(C14, Fe53, 0.0); + + jac.set(C14, Fe54, 0.0); + + jac.set(C14, Fe55, 0.0); + + jac.set(C14, Fe56, 0.0); + + jac.set(C14, Co55, 0.0); + + jac.set(C14, Co56, 0.0); + + jac.set(C14, Co57, 0.0); + + jac.set(C14, Ni56, 0.0); + + jac.set(C14, Ni57, 0.0); + + jac.set(C14, Ni58, 0.0); + + jac.set(C14, Cu59, 0.0); + + jac.set(C14, Zn60, 0.0); + + jac.set(N13, N, 0.0); + + scratch = screened_rates(k_p_C12_to_N13_reaclib)*Y(C12)*state.rho + screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*state.rho; + jac.set(N13, H1, scratch); + + scratch = -screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(N13)*state.rho; + jac.set(N13, He4, scratch); + + scratch = screened_rates(k_p_C12_to_N13_reaclib)*Y(H1)*state.rho; + jac.set(N13, C12, scratch); + + jac.set(N13, C13, 0.0); + + jac.set(N13, C14, 0.0); + + scratch = -screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*state.rho - screened_rates(k_N13_to_C13_reaclib) - screened_rates(k_N13_to_p_C12_derived); + jac.set(N13, N13, scratch); + + jac.set(N13, N14, 0.0); + + jac.set(N13, N15, 0.0); + + scratch = screened_rates(k_p_O16_to_He4_N13_derived)*Y(H1)*state.rho; + jac.set(N13, O16, scratch); + + jac.set(N13, O17, 0.0); + + jac.set(N13, O18, 0.0); + + jac.set(N13, F18, 0.0); + + jac.set(N13, F19, 0.0); + + jac.set(N13, Ne20, 0.0); + + jac.set(N13, Ne21, 0.0); + + jac.set(N13, Ne22, 0.0); + + jac.set(N13, Na22, 0.0); + + jac.set(N13, Na23, 0.0); + + jac.set(N13, Mg24, 0.0); + + jac.set(N13, Mg25, 0.0); + + jac.set(N13, Al26, 0.0); + + jac.set(N13, Al27, 0.0); + + jac.set(N13, Si28, 0.0); + + jac.set(N13, Si29, 0.0); + + jac.set(N13, P30, 0.0); + + jac.set(N13, P31, 0.0); + + jac.set(N13, S32, 0.0); + + jac.set(N13, S33, 0.0); + + jac.set(N13, Cl34, 0.0); + + jac.set(N13, Cl35, 0.0); + + jac.set(N13, Ar36, 0.0); + + jac.set(N13, Ar37, 0.0); + + jac.set(N13, K38, 0.0); + + jac.set(N13, K39, 0.0); + + jac.set(N13, Ca40, 0.0); + + jac.set(N13, Ca41, 0.0); + + jac.set(N13, Sc42, 0.0); + + jac.set(N13, Sc43, 0.0); + + jac.set(N13, Ti44, 0.0); + + jac.set(N13, Ti45, 0.0); + + jac.set(N13, V46, 0.0); + + jac.set(N13, V47, 0.0); + + jac.set(N13, Cr48, 0.0); + + jac.set(N13, Cr49, 0.0); + + jac.set(N13, Mn50, 0.0); + + jac.set(N13, Mn51, 0.0); + + jac.set(N13, Mn52, 0.0); + + jac.set(N13, Fe52, 0.0); + + jac.set(N13, Fe53, 0.0); + + jac.set(N13, Fe54, 0.0); + + jac.set(N13, Fe55, 0.0); + + jac.set(N13, Fe56, 0.0); + + jac.set(N13, Co55, 0.0); + + jac.set(N13, Co56, 0.0); + + jac.set(N13, Co57, 0.0); + + jac.set(N13, Ni56, 0.0); + + jac.set(N13, Ni57, 0.0); + + jac.set(N13, Ni58, 0.0); + + jac.set(N13, Cu59, 0.0); + + jac.set(N13, Zn60, 0.0); + + jac.set(N14, N, 0.0); + + scratch = screened_rates(k_p_C13_to_N14_reaclib)*Y(C13)*state.rho + screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*state.rho; + jac.set(N14, H1, scratch); + + scratch = -screened_rates(k_He4_N14_to_F18_reaclib)*Y(N14)*state.rho - screened_rates(k_He4_N14_to_p_O17_derived)*Y(N14)*state.rho; + jac.set(N14, He4, scratch); + + jac.set(N14, C12, 0.0); + + scratch = screened_rates(k_p_C13_to_N14_reaclib)*Y(H1)*state.rho; + jac.set(N14, C13, scratch); + + scratch = screened_rates(k_C14_to_N14_reaclib); + jac.set(N14, C14, scratch); + + jac.set(N14, N13, 0.0); + + scratch = -screened_rates(k_He4_N14_to_F18_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*state.rho - screened_rates(k_N14_to_p_C13_derived); + jac.set(N14, N14, scratch); + + jac.set(N14, N15, 0.0); + + jac.set(N14, O16, 0.0); + + scratch = screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(H1)*state.rho; + jac.set(N14, O17, scratch); + + jac.set(N14, O18, 0.0); + + scratch = screened_rates(k_F18_to_He4_N14_derived); + jac.set(N14, F18, scratch); + + jac.set(N14, F19, 0.0); + + jac.set(N14, Ne20, 0.0); + + jac.set(N14, Ne21, 0.0); + + jac.set(N14, Ne22, 0.0); + + jac.set(N14, Na22, 0.0); + + jac.set(N14, Na23, 0.0); + + jac.set(N14, Mg24, 0.0); + + jac.set(N14, Mg25, 0.0); + + jac.set(N14, Al26, 0.0); + + jac.set(N14, Al27, 0.0); + + jac.set(N14, Si28, 0.0); + + jac.set(N14, Si29, 0.0); + + jac.set(N14, P30, 0.0); + + jac.set(N14, P31, 0.0); + + jac.set(N14, S32, 0.0); + + jac.set(N14, S33, 0.0); + + jac.set(N14, Cl34, 0.0); + + jac.set(N14, Cl35, 0.0); + + jac.set(N14, Ar36, 0.0); + + jac.set(N14, Ar37, 0.0); + + jac.set(N14, K38, 0.0); + + jac.set(N14, K39, 0.0); + + jac.set(N14, Ca40, 0.0); + + jac.set(N14, Ca41, 0.0); + + jac.set(N14, Sc42, 0.0); + + jac.set(N14, Sc43, 0.0); + + jac.set(N14, Ti44, 0.0); + + jac.set(N14, Ti45, 0.0); + + jac.set(N14, V46, 0.0); + + jac.set(N14, V47, 0.0); + + jac.set(N14, Cr48, 0.0); + + jac.set(N14, Cr49, 0.0); + + jac.set(N14, Mn50, 0.0); + + jac.set(N14, Mn51, 0.0); + + jac.set(N14, Mn52, 0.0); + + jac.set(N14, Fe52, 0.0); + + jac.set(N14, Fe53, 0.0); + + jac.set(N14, Fe54, 0.0); + + jac.set(N14, Fe55, 0.0); + + jac.set(N14, Fe56, 0.0); + + jac.set(N14, Co55, 0.0); + + jac.set(N14, Co56, 0.0); + + jac.set(N14, Co57, 0.0); + + jac.set(N14, Ni56, 0.0); + + jac.set(N14, Ni57, 0.0); + + jac.set(N14, Ni58, 0.0); + + jac.set(N14, Cu59, 0.0); + + jac.set(N14, Zn60, 0.0); + + jac.set(N15, N, 0.0); + + scratch = screened_rates(k_p_C14_to_N15_reaclib)*Y(C14)*state.rho - screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(N15)*state.rho - screened_rates(k_p_N15_to_O16_reaclib)*Y(N15)*state.rho + screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*state.rho; + jac.set(N15, H1, scratch); + + scratch = screened_rates(k_He4_C12_to_p_N15_derived)*Y(C12)*state.rho - screened_rates(k_He4_N15_to_F19_reaclib)*Y(N15)*state.rho - screened_rates(k_He4_N15_to_p_O18_derived)*Y(N15)*state.rho; + jac.set(N15, He4, scratch); + + scratch = screened_rates(k_He4_C12_to_p_N15_derived)*Y(He4)*state.rho; + jac.set(N15, C12, scratch); + + jac.set(N15, C13, 0.0); + + scratch = screened_rates(k_p_C14_to_N15_reaclib)*Y(H1)*state.rho; + jac.set(N15, C14, scratch); + + jac.set(N15, N13, 0.0); + + jac.set(N15, N14, 0.0); + + scratch = -screened_rates(k_He4_N15_to_F19_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*state.rho - screened_rates(k_N15_to_p_C14_derived) - screened_rates(k_p_N15_to_He4_C12_reaclib)*Y(H1)*state.rho - screened_rates(k_p_N15_to_O16_reaclib)*Y(H1)*state.rho; + jac.set(N15, N15, scratch); + + scratch = screened_rates(k_O16_to_p_N15_derived); + jac.set(N15, O16, scratch); + + jac.set(N15, O17, 0.0); + + scratch = screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(H1)*state.rho; + jac.set(N15, O18, scratch); + + jac.set(N15, F18, 0.0); + + scratch = screened_rates(k_F19_to_He4_N15_derived); + jac.set(N15, F19, scratch); + + jac.set(N15, Ne20, 0.0); + + jac.set(N15, Ne21, 0.0); + + jac.set(N15, Ne22, 0.0); + + jac.set(N15, Na22, 0.0); + + jac.set(N15, Na23, 0.0); + + jac.set(N15, Mg24, 0.0); + + jac.set(N15, Mg25, 0.0); + + jac.set(N15, Al26, 0.0); + + jac.set(N15, Al27, 0.0); + + jac.set(N15, Si28, 0.0); + + jac.set(N15, Si29, 0.0); + + jac.set(N15, P30, 0.0); + + jac.set(N15, P31, 0.0); + + jac.set(N15, S32, 0.0); + + jac.set(N15, S33, 0.0); + + jac.set(N15, Cl34, 0.0); + + jac.set(N15, Cl35, 0.0); + + jac.set(N15, Ar36, 0.0); + + jac.set(N15, Ar37, 0.0); + + jac.set(N15, K38, 0.0); + + jac.set(N15, K39, 0.0); + + jac.set(N15, Ca40, 0.0); + + jac.set(N15, Ca41, 0.0); + + jac.set(N15, Sc42, 0.0); + + jac.set(N15, Sc43, 0.0); + + jac.set(N15, Ti44, 0.0); + + jac.set(N15, Ti45, 0.0); + + jac.set(N15, V46, 0.0); + + jac.set(N15, V47, 0.0); + + jac.set(N15, Cr48, 0.0); + + jac.set(N15, Cr49, 0.0); + + jac.set(N15, Mn50, 0.0); + + jac.set(N15, Mn51, 0.0); + + jac.set(N15, Mn52, 0.0); + + jac.set(N15, Fe52, 0.0); + + jac.set(N15, Fe53, 0.0); + + jac.set(N15, Fe54, 0.0); + + jac.set(N15, Fe55, 0.0); + + jac.set(N15, Fe56, 0.0); + + jac.set(N15, Co55, 0.0); + + jac.set(N15, Co56, 0.0); + + jac.set(N15, Co57, 0.0); + + jac.set(N15, Ni56, 0.0); + + jac.set(N15, Ni57, 0.0); + + jac.set(N15, Ni58, 0.0); + + jac.set(N15, Cu59, 0.0); + + jac.set(N15, Zn60, 0.0); + + jac.set(O16, N, 0.0); + + scratch = screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*state.rho + screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*state.rho + screened_rates(k_p_N15_to_O16_reaclib)*Y(N15)*state.rho - screened_rates(k_p_O16_to_He4_N13_derived)*Y(O16)*state.rho + 2.0*screened_rates(k_p_P31_to_O16_O16_derived)*Y(P31)*state.rho; + jac.set(O16, H1, scratch); + + scratch = screened_rates(k_He4_C12_to_O16_reaclib)*Y(C12)*state.rho + screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(Mg24)*state.rho + screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(N13)*state.rho - screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(O16)*state.rho - screened_rates(k_He4_O16_to_p_F19_derived)*Y(O16)*state.rho + 2.0*screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(Si28)*state.rho; + jac.set(O16, He4, scratch); + + scratch = -screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(O16)*state.rho - screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(O16)*state.rho + screened_rates(k_He4_C12_to_O16_reaclib)*Y(He4)*state.rho; + jac.set(O16, C12, scratch); + + jac.set(O16, C13, 0.0); + + jac.set(O16, C14, 0.0); + + scratch = screened_rates(k_He4_N13_to_p_O16_reaclib)*Y(He4)*state.rho; + jac.set(O16, N13, scratch); + + jac.set(O16, N14, 0.0); + + scratch = screened_rates(k_p_N15_to_O16_reaclib)*Y(H1)*state.rho; + jac.set(O16, N15, scratch); + + scratch = -screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*state.rho - screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*state.rho - screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*state.rho - 2.0*screened_rates(k_O16_O16_to_He4_Si28_reaclib)*Y(O16)*state.rho - 2.0*screened_rates(k_O16_O16_to_p_P31_reaclib)*Y(O16)*state.rho - screened_rates(k_O16_to_He4_C12_derived) - screened_rates(k_O16_to_p_N15_derived) - screened_rates(k_p_O16_to_He4_N13_derived)*Y(H1)*state.rho; + jac.set(O16, O16, scratch); + + jac.set(O16, O17, 0.0); + + jac.set(O16, O18, 0.0); + + jac.set(O16, F18, 0.0); + + scratch = screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(H1)*state.rho; + jac.set(O16, F19, scratch); + + scratch = screened_rates(k_Ne20_to_He4_O16_derived); + jac.set(O16, Ne20, scratch); + + jac.set(O16, Ne21, 0.0); + + jac.set(O16, Ne22, 0.0); + + jac.set(O16, Na22, 0.0); + + jac.set(O16, Na23, 0.0); + + scratch = screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*state.rho; + jac.set(O16, Mg24, scratch); + + jac.set(O16, Mg25, 0.0); + + jac.set(O16, Al26, 0.0); + + scratch = screened_rates(k_p_Al27_to_C12_O16_derived)*Y(H1)*state.rho; + jac.set(O16, Al27, scratch); + + scratch = 2.0*screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(He4)*state.rho; + jac.set(O16, Si28, scratch); + + jac.set(O16, Si29, 0.0); + + jac.set(O16, P30, 0.0); + + scratch = 2.0*screened_rates(k_p_P31_to_O16_O16_derived)*Y(H1)*state.rho; + jac.set(O16, P31, scratch); + + jac.set(O16, S32, 0.0); + + jac.set(O16, S33, 0.0); + + jac.set(O16, Cl34, 0.0); + + jac.set(O16, Cl35, 0.0); + + jac.set(O16, Ar36, 0.0); + + jac.set(O16, Ar37, 0.0); + + jac.set(O16, K38, 0.0); + + jac.set(O16, K39, 0.0); + + jac.set(O16, Ca40, 0.0); + + jac.set(O16, Ca41, 0.0); + + jac.set(O16, Sc42, 0.0); + + jac.set(O16, Sc43, 0.0); + + jac.set(O16, Ti44, 0.0); + + jac.set(O16, Ti45, 0.0); + + jac.set(O16, V46, 0.0); + + jac.set(O16, V47, 0.0); + + jac.set(O16, Cr48, 0.0); + + jac.set(O16, Cr49, 0.0); + + jac.set(O16, Mn50, 0.0); + + jac.set(O16, Mn51, 0.0); + + jac.set(O16, Mn52, 0.0); + + jac.set(O16, Fe52, 0.0); + + jac.set(O16, Fe53, 0.0); + + jac.set(O16, Fe54, 0.0); + + jac.set(O16, Fe55, 0.0); + + jac.set(O16, Fe56, 0.0); + + jac.set(O16, Co55, 0.0); + + jac.set(O16, Co56, 0.0); + + jac.set(O16, Co57, 0.0); + + jac.set(O16, Ni56, 0.0); + + jac.set(O16, Ni57, 0.0); + + jac.set(O16, Ni58, 0.0); + + jac.set(O16, Cu59, 0.0); + + jac.set(O16, Zn60, 0.0); + + jac.set(O17, N, 0.0); + + scratch = -screened_rates(k_p_O17_to_F18_reaclib)*Y(O17)*state.rho - screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(O17)*state.rho; + jac.set(O17, H1, scratch); + + scratch = screened_rates(k_He4_N14_to_p_O17_derived)*Y(N14)*state.rho - screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(O17)*state.rho; + jac.set(O17, He4, scratch); + + jac.set(O17, C12, 0.0); + + jac.set(O17, C13, 0.0); + + jac.set(O17, C14, 0.0); + + jac.set(O17, N13, 0.0); + + scratch = screened_rates(k_He4_N14_to_p_O17_derived)*Y(He4)*state.rho; + jac.set(O17, N14, scratch); + + jac.set(O17, N15, 0.0); + + jac.set(O17, O16, 0.0); + + scratch = -screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(He4)*state.rho - screened_rates(k_p_O17_to_F18_reaclib)*Y(H1)*state.rho - screened_rates(k_p_O17_to_He4_N14_reaclib)*Y(H1)*state.rho; + jac.set(O17, O17, scratch); + + jac.set(O17, O18, 0.0); + + scratch = screened_rates(k_F18_to_p_O17_derived); + jac.set(O17, F18, scratch); + + jac.set(O17, F19, 0.0); + + jac.set(O17, Ne20, 0.0); + + scratch = screened_rates(k_Ne21_to_He4_O17_derived); + jac.set(O17, Ne21, scratch); + + jac.set(O17, Ne22, 0.0); + + jac.set(O17, Na22, 0.0); + + jac.set(O17, Na23, 0.0); + + jac.set(O17, Mg24, 0.0); + + jac.set(O17, Mg25, 0.0); + + jac.set(O17, Al26, 0.0); + + jac.set(O17, Al27, 0.0); + + jac.set(O17, Si28, 0.0); + + jac.set(O17, Si29, 0.0); + + jac.set(O17, P30, 0.0); + + jac.set(O17, P31, 0.0); + + jac.set(O17, S32, 0.0); + + jac.set(O17, S33, 0.0); + + jac.set(O17, Cl34, 0.0); + + jac.set(O17, Cl35, 0.0); + + jac.set(O17, Ar36, 0.0); + + jac.set(O17, Ar37, 0.0); + + jac.set(O17, K38, 0.0); + + jac.set(O17, K39, 0.0); + + jac.set(O17, Ca40, 0.0); + + jac.set(O17, Ca41, 0.0); + + jac.set(O17, Sc42, 0.0); + + jac.set(O17, Sc43, 0.0); + + jac.set(O17, Ti44, 0.0); + + jac.set(O17, Ti45, 0.0); + + jac.set(O17, V46, 0.0); + + jac.set(O17, V47, 0.0); + + jac.set(O17, Cr48, 0.0); + + jac.set(O17, Cr49, 0.0); + + jac.set(O17, Mn50, 0.0); + + jac.set(O17, Mn51, 0.0); + + jac.set(O17, Mn52, 0.0); + + jac.set(O17, Fe52, 0.0); + + jac.set(O17, Fe53, 0.0); + + jac.set(O17, Fe54, 0.0); + + jac.set(O17, Fe55, 0.0); + + jac.set(O17, Fe56, 0.0); + + jac.set(O17, Co55, 0.0); + + jac.set(O17, Co56, 0.0); + + jac.set(O17, Co57, 0.0); + + jac.set(O17, Ni56, 0.0); + + jac.set(O17, Ni57, 0.0); + + jac.set(O17, Ni58, 0.0); + + jac.set(O17, Cu59, 0.0); + + jac.set(O17, Zn60, 0.0); + + jac.set(O18, N, 0.0); + + scratch = -screened_rates(k_p_O18_to_F19_reaclib)*Y(O18)*state.rho - screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(O18)*state.rho; + jac.set(O18, H1, scratch); + + scratch = screened_rates(k_He4_C14_to_O18_reaclib)*Y(C14)*state.rho + screened_rates(k_He4_N15_to_p_O18_derived)*Y(N15)*state.rho - screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(O18)*state.rho; + jac.set(O18, He4, scratch); + + jac.set(O18, C12, 0.0); + + jac.set(O18, C13, 0.0); + + scratch = screened_rates(k_He4_C14_to_O18_reaclib)*Y(He4)*state.rho; + jac.set(O18, C14, scratch); + + jac.set(O18, N13, 0.0); + + jac.set(O18, N14, 0.0); + + scratch = screened_rates(k_He4_N15_to_p_O18_derived)*Y(He4)*state.rho; + jac.set(O18, N15, scratch); + + jac.set(O18, O16, 0.0); + + jac.set(O18, O17, 0.0); + + scratch = -screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(He4)*state.rho - screened_rates(k_O18_to_F18_weaktab) - screened_rates(k_O18_to_He4_C14_derived) - screened_rates(k_p_O18_to_F19_reaclib)*Y(H1)*state.rho - screened_rates(k_p_O18_to_He4_N15_reaclib)*Y(H1)*state.rho; + jac.set(O18, O18, scratch); + + scratch = screened_rates(k_F18_to_O18_weaktab); + jac.set(O18, F18, scratch); + + scratch = screened_rates(k_F19_to_p_O18_derived); + jac.set(O18, F19, scratch); + + jac.set(O18, Ne20, 0.0); + + jac.set(O18, Ne21, 0.0); + + scratch = screened_rates(k_Ne22_to_He4_O18_derived); + jac.set(O18, Ne22, scratch); + + jac.set(O18, Na22, 0.0); + + jac.set(O18, Na23, 0.0); + + jac.set(O18, Mg24, 0.0); + + jac.set(O18, Mg25, 0.0); + + jac.set(O18, Al26, 0.0); + + jac.set(O18, Al27, 0.0); + + jac.set(O18, Si28, 0.0); + + jac.set(O18, Si29, 0.0); + + jac.set(O18, P30, 0.0); + + jac.set(O18, P31, 0.0); + + jac.set(O18, S32, 0.0); + + jac.set(O18, S33, 0.0); + + jac.set(O18, Cl34, 0.0); + + jac.set(O18, Cl35, 0.0); + + jac.set(O18, Ar36, 0.0); + + jac.set(O18, Ar37, 0.0); + + jac.set(O18, K38, 0.0); + + jac.set(O18, K39, 0.0); + + jac.set(O18, Ca40, 0.0); + + jac.set(O18, Ca41, 0.0); + + jac.set(O18, Sc42, 0.0); + + jac.set(O18, Sc43, 0.0); + + jac.set(O18, Ti44, 0.0); + + jac.set(O18, Ti45, 0.0); + + jac.set(O18, V46, 0.0); + + jac.set(O18, V47, 0.0); + + jac.set(O18, Cr48, 0.0); + + jac.set(O18, Cr49, 0.0); + + jac.set(O18, Mn50, 0.0); + + jac.set(O18, Mn51, 0.0); + + jac.set(O18, Mn52, 0.0); + + jac.set(O18, Fe52, 0.0); + + jac.set(O18, Fe53, 0.0); + + jac.set(O18, Fe54, 0.0); + + jac.set(O18, Fe55, 0.0); + + jac.set(O18, Fe56, 0.0); + + jac.set(O18, Co55, 0.0); + + jac.set(O18, Co56, 0.0); + + jac.set(O18, Co57, 0.0); + + jac.set(O18, Ni56, 0.0); + + jac.set(O18, Ni57, 0.0); + + jac.set(O18, Ni58, 0.0); + + jac.set(O18, Cu59, 0.0); + + jac.set(O18, Zn60, 0.0); + + jac.set(F18, N, 0.0); + + scratch = screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*state.rho + screened_rates(k_p_O17_to_F18_reaclib)*Y(O17)*state.rho; + jac.set(F18, H1, scratch); + + scratch = -screened_rates(k_He4_F18_to_Na22_reaclib)*Y(F18)*state.rho - screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*state.rho + screened_rates(k_He4_N14_to_F18_reaclib)*Y(N14)*state.rho; + jac.set(F18, He4, scratch); + + jac.set(F18, C12, 0.0); + + jac.set(F18, C13, 0.0); + + jac.set(F18, C14, 0.0); + + jac.set(F18, N13, 0.0); + + scratch = screened_rates(k_He4_N14_to_F18_reaclib)*Y(He4)*state.rho; + jac.set(F18, N14, scratch); + + jac.set(F18, N15, 0.0); + + jac.set(F18, O16, 0.0); + + scratch = screened_rates(k_p_O17_to_F18_reaclib)*Y(H1)*state.rho; + jac.set(F18, O17, scratch); + + scratch = screened_rates(k_O18_to_F18_weaktab); + jac.set(F18, O18, scratch); + + scratch = -screened_rates(k_F18_to_He4_N14_derived) - screened_rates(k_F18_to_O18_weaktab) - screened_rates(k_F18_to_p_O17_derived) - screened_rates(k_He4_F18_to_Na22_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(He4)*state.rho; + jac.set(F18, F18, scratch); + + jac.set(F18, F19, 0.0); + + jac.set(F18, Ne20, 0.0); + + scratch = screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(H1)*state.rho; + jac.set(F18, Ne21, scratch); + + jac.set(F18, Ne22, 0.0); + + scratch = screened_rates(k_Na22_to_He4_F18_derived); + jac.set(F18, Na22, scratch); + + jac.set(F18, Na23, 0.0); + + jac.set(F18, Mg24, 0.0); + + jac.set(F18, Mg25, 0.0); + + jac.set(F18, Al26, 0.0); + + jac.set(F18, Al27, 0.0); + + jac.set(F18, Si28, 0.0); + + jac.set(F18, Si29, 0.0); + + jac.set(F18, P30, 0.0); + + jac.set(F18, P31, 0.0); + + jac.set(F18, S32, 0.0); + + jac.set(F18, S33, 0.0); + + jac.set(F18, Cl34, 0.0); + + jac.set(F18, Cl35, 0.0); + + jac.set(F18, Ar36, 0.0); + + jac.set(F18, Ar37, 0.0); + + jac.set(F18, K38, 0.0); + + jac.set(F18, K39, 0.0); + + jac.set(F18, Ca40, 0.0); + + jac.set(F18, Ca41, 0.0); + + jac.set(F18, Sc42, 0.0); + + jac.set(F18, Sc43, 0.0); + + jac.set(F18, Ti44, 0.0); + + jac.set(F18, Ti45, 0.0); + + jac.set(F18, V46, 0.0); + + jac.set(F18, V47, 0.0); + + jac.set(F18, Cr48, 0.0); + + jac.set(F18, Cr49, 0.0); + + jac.set(F18, Mn50, 0.0); + + jac.set(F18, Mn51, 0.0); + + jac.set(F18, Mn52, 0.0); + + jac.set(F18, Fe52, 0.0); + + jac.set(F18, Fe53, 0.0); + + jac.set(F18, Fe54, 0.0); + + jac.set(F18, Fe55, 0.0); + + jac.set(F18, Fe56, 0.0); + + jac.set(F18, Co55, 0.0); + + jac.set(F18, Co56, 0.0); + + jac.set(F18, Co57, 0.0); + + jac.set(F18, Ni56, 0.0); + + jac.set(F18, Ni57, 0.0); + + jac.set(F18, Ni58, 0.0); + + jac.set(F18, Cu59, 0.0); + + jac.set(F18, Zn60, 0.0); + + jac.set(F19, N, 0.0); + + scratch = -screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(F19)*state.rho - screened_rates(k_p_F19_to_Ne20_reaclib)*Y(F19)*state.rho + screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*state.rho + screened_rates(k_p_O18_to_F19_reaclib)*Y(O18)*state.rho; + jac.set(F19, H1, scratch); + + scratch = -screened_rates(k_He4_F19_to_Na23_reaclib)*Y(F19)*state.rho - screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*state.rho + screened_rates(k_He4_N15_to_F19_reaclib)*Y(N15)*state.rho + screened_rates(k_He4_O16_to_p_F19_derived)*Y(O16)*state.rho; + jac.set(F19, He4, scratch); + + jac.set(F19, C12, 0.0); + + jac.set(F19, C13, 0.0); + + jac.set(F19, C14, 0.0); + + jac.set(F19, N13, 0.0); + + jac.set(F19, N14, 0.0); + + scratch = screened_rates(k_He4_N15_to_F19_reaclib)*Y(He4)*state.rho; + jac.set(F19, N15, scratch); + + scratch = screened_rates(k_He4_O16_to_p_F19_derived)*Y(He4)*state.rho; + jac.set(F19, O16, scratch); + + jac.set(F19, O17, 0.0); + + scratch = screened_rates(k_p_O18_to_F19_reaclib)*Y(H1)*state.rho; + jac.set(F19, O18, scratch); + + jac.set(F19, F18, 0.0); + + scratch = -screened_rates(k_F19_to_He4_N15_derived) - screened_rates(k_F19_to_p_O18_derived) - screened_rates(k_He4_F19_to_Na23_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(He4)*state.rho - screened_rates(k_p_F19_to_He4_O16_reaclib)*Y(H1)*state.rho - screened_rates(k_p_F19_to_Ne20_reaclib)*Y(H1)*state.rho; + jac.set(F19, F19, scratch); + + scratch = screened_rates(k_Ne20_to_p_F19_derived); + jac.set(F19, Ne20, scratch); + + jac.set(F19, Ne21, 0.0); + + scratch = screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(H1)*state.rho; + jac.set(F19, Ne22, scratch); + + jac.set(F19, Na22, 0.0); + + scratch = screened_rates(k_Na23_to_He4_F19_derived); + jac.set(F19, Na23, scratch); + + jac.set(F19, Mg24, 0.0); + + jac.set(F19, Mg25, 0.0); + + jac.set(F19, Al26, 0.0); + + jac.set(F19, Al27, 0.0); + + jac.set(F19, Si28, 0.0); + + jac.set(F19, Si29, 0.0); + + jac.set(F19, P30, 0.0); + + jac.set(F19, P31, 0.0); + + jac.set(F19, S32, 0.0); + + jac.set(F19, S33, 0.0); + + jac.set(F19, Cl34, 0.0); + + jac.set(F19, Cl35, 0.0); + + jac.set(F19, Ar36, 0.0); + + jac.set(F19, Ar37, 0.0); + + jac.set(F19, K38, 0.0); + + jac.set(F19, K39, 0.0); + + jac.set(F19, Ca40, 0.0); + + jac.set(F19, Ca41, 0.0); + + jac.set(F19, Sc42, 0.0); + + jac.set(F19, Sc43, 0.0); + + jac.set(F19, Ti44, 0.0); + + jac.set(F19, Ti45, 0.0); + + jac.set(F19, V46, 0.0); + + jac.set(F19, V47, 0.0); + + jac.set(F19, Cr48, 0.0); + + jac.set(F19, Cr49, 0.0); + + jac.set(F19, Mn50, 0.0); + + jac.set(F19, Mn51, 0.0); + + jac.set(F19, Mn52, 0.0); + + jac.set(F19, Fe52, 0.0); + + jac.set(F19, Fe53, 0.0); + + jac.set(F19, Fe54, 0.0); + + jac.set(F19, Fe55, 0.0); + + jac.set(F19, Fe56, 0.0); + + jac.set(F19, Co55, 0.0); + + jac.set(F19, Co56, 0.0); + + jac.set(F19, Co57, 0.0); + + jac.set(F19, Ni56, 0.0); + + jac.set(F19, Ni57, 0.0); + + jac.set(F19, Ni58, 0.0); + + jac.set(F19, Cu59, 0.0); + + jac.set(F19, Zn60, 0.0); + + jac.set(Ne20, N, 0.0); + + scratch = screened_rates(k_p_F19_to_Ne20_reaclib)*Y(F19)*state.rho + screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*state.rho + screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*state.rho; + jac.set(Ne20, H1, scratch); + + scratch = -screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(Ne20)*state.rho - screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(Ne20)*state.rho - screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(Ne20)*state.rho + screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(O16)*state.rho + screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(Si28)*state.rho; + jac.set(Ne20, He4, scratch); + + scratch = 1.0*screened_rates(k_C12_C12_to_He4_Ne20_reaclib)*Y(C12)*state.rho - screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(Ne20)*state.rho - screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(Ne20)*state.rho; + jac.set(Ne20, C12, scratch); + + jac.set(Ne20, C13, 0.0); + + jac.set(Ne20, C14, 0.0); + + jac.set(Ne20, N13, 0.0); + + jac.set(Ne20, N14, 0.0); + + jac.set(Ne20, N15, 0.0); + + scratch = screened_rates(k_He4_O16_to_Ne20_reaclib)*Y(He4)*state.rho; + jac.set(Ne20, O16, scratch); + + jac.set(Ne20, O17, 0.0); + + jac.set(Ne20, O18, 0.0); + + jac.set(Ne20, F18, 0.0); + + scratch = screened_rates(k_p_F19_to_Ne20_reaclib)*Y(H1)*state.rho; + jac.set(Ne20, F19, scratch); + + scratch = -screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*state.rho - screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*state.rho - screened_rates(k_He4_Ne20_to_C12_C12_derived)*Y(He4)*state.rho - screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*state.rho - screened_rates(k_Ne20_to_He4_O16_derived) - screened_rates(k_Ne20_to_p_F19_derived); + jac.set(Ne20, Ne20, scratch); + + jac.set(Ne20, Ne21, 0.0); + + jac.set(Ne20, Ne22, 0.0); + + jac.set(Ne20, Na22, 0.0); + + scratch = screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(H1)*state.rho; + jac.set(Ne20, Na23, scratch); + + scratch = screened_rates(k_Mg24_to_He4_Ne20_derived); + jac.set(Ne20, Mg24, scratch); + + jac.set(Ne20, Mg25, 0.0); + + jac.set(Ne20, Al26, 0.0); + + jac.set(Ne20, Al27, 0.0); + + scratch = screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*state.rho; + jac.set(Ne20, Si28, scratch); + + jac.set(Ne20, Si29, 0.0); + + jac.set(Ne20, P30, 0.0); + + scratch = screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(H1)*state.rho; + jac.set(Ne20, P31, scratch); + + jac.set(Ne20, S32, 0.0); + + jac.set(Ne20, S33, 0.0); + + jac.set(Ne20, Cl34, 0.0); + + jac.set(Ne20, Cl35, 0.0); + + jac.set(Ne20, Ar36, 0.0); + + jac.set(Ne20, Ar37, 0.0); + + jac.set(Ne20, K38, 0.0); + + jac.set(Ne20, K39, 0.0); + + jac.set(Ne20, Ca40, 0.0); + + jac.set(Ne20, Ca41, 0.0); + + jac.set(Ne20, Sc42, 0.0); + + jac.set(Ne20, Sc43, 0.0); + + jac.set(Ne20, Ti44, 0.0); + + jac.set(Ne20, Ti45, 0.0); + + jac.set(Ne20, V46, 0.0); + + jac.set(Ne20, V47, 0.0); + + jac.set(Ne20, Cr48, 0.0); + + jac.set(Ne20, Cr49, 0.0); + + jac.set(Ne20, Mn50, 0.0); + + jac.set(Ne20, Mn51, 0.0); + + jac.set(Ne20, Mn52, 0.0); + + jac.set(Ne20, Fe52, 0.0); + + jac.set(Ne20, Fe53, 0.0); + + jac.set(Ne20, Fe54, 0.0); + + jac.set(Ne20, Fe55, 0.0); + + jac.set(Ne20, Fe56, 0.0); + + jac.set(Ne20, Co55, 0.0); + + jac.set(Ne20, Co56, 0.0); + + jac.set(Ne20, Co57, 0.0); + + jac.set(Ne20, Ni56, 0.0); + + jac.set(Ne20, Ni57, 0.0); + + jac.set(Ne20, Ni58, 0.0); + + jac.set(Ne20, Cu59, 0.0); + + jac.set(Ne20, Zn60, 0.0); + + jac.set(Ne21, N, 0.0); + + scratch = -screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(Ne21)*state.rho - screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(Ne21)*state.rho; + jac.set(Ne21, H1, scratch); + + scratch = screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(F18)*state.rho - screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(Ne21)*state.rho + screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(O17)*state.rho; + jac.set(Ne21, He4, scratch); + + jac.set(Ne21, C12, 0.0); + + jac.set(Ne21, C13, 0.0); + + jac.set(Ne21, C14, 0.0); + + jac.set(Ne21, N13, 0.0); + + jac.set(Ne21, N14, 0.0); + + jac.set(Ne21, N15, 0.0); + + jac.set(Ne21, O16, 0.0); + + scratch = screened_rates(k_He4_O17_to_Ne21_reaclib)*Y(He4)*state.rho; + jac.set(Ne21, O17, scratch); + + jac.set(Ne21, O18, 0.0); + + scratch = screened_rates(k_He4_F18_to_p_Ne21_reaclib)*Y(He4)*state.rho; + jac.set(Ne21, F18, scratch); + + jac.set(Ne21, F19, 0.0); + + jac.set(Ne21, Ne20, 0.0); + + scratch = -screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(He4)*state.rho - screened_rates(k_Ne21_to_He4_O17_derived) - screened_rates(k_p_Ne21_to_He4_F18_derived)*Y(H1)*state.rho - screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(H1)*state.rho; + jac.set(Ne21, Ne21, scratch); + + jac.set(Ne21, Ne22, 0.0); + + scratch = screened_rates(k_Na22_to_p_Ne21_derived); + jac.set(Ne21, Na22, scratch); + + jac.set(Ne21, Na23, 0.0); + + jac.set(Ne21, Mg24, 0.0); + + scratch = screened_rates(k_Mg25_to_He4_Ne21_derived); + jac.set(Ne21, Mg25, scratch); + + jac.set(Ne21, Al26, 0.0); + + jac.set(Ne21, Al27, 0.0); + + jac.set(Ne21, Si28, 0.0); + + jac.set(Ne21, Si29, 0.0); + + jac.set(Ne21, P30, 0.0); + + jac.set(Ne21, P31, 0.0); + + jac.set(Ne21, S32, 0.0); + + jac.set(Ne21, S33, 0.0); + + jac.set(Ne21, Cl34, 0.0); + + jac.set(Ne21, Cl35, 0.0); + + jac.set(Ne21, Ar36, 0.0); + + jac.set(Ne21, Ar37, 0.0); + + jac.set(Ne21, K38, 0.0); + + jac.set(Ne21, K39, 0.0); + + jac.set(Ne21, Ca40, 0.0); + + jac.set(Ne21, Ca41, 0.0); + + jac.set(Ne21, Sc42, 0.0); + + jac.set(Ne21, Sc43, 0.0); + + jac.set(Ne21, Ti44, 0.0); + + jac.set(Ne21, Ti45, 0.0); + + jac.set(Ne21, V46, 0.0); + + jac.set(Ne21, V47, 0.0); + + jac.set(Ne21, Cr48, 0.0); + + jac.set(Ne21, Cr49, 0.0); + + jac.set(Ne21, Mn50, 0.0); + + jac.set(Ne21, Mn51, 0.0); + + jac.set(Ne21, Mn52, 0.0); + + jac.set(Ne21, Fe52, 0.0); + + jac.set(Ne21, Fe53, 0.0); + + jac.set(Ne21, Fe54, 0.0); + + jac.set(Ne21, Fe55, 0.0); + + jac.set(Ne21, Fe56, 0.0); + + jac.set(Ne21, Co55, 0.0); + + jac.set(Ne21, Co56, 0.0); + + jac.set(Ne21, Co57, 0.0); + + jac.set(Ne21, Ni56, 0.0); + + jac.set(Ne21, Ni57, 0.0); + + jac.set(Ne21, Ni58, 0.0); + + jac.set(Ne21, Cu59, 0.0); + + jac.set(Ne21, Zn60, 0.0); + + jac.set(Ne22, N, 0.0); + + scratch = -screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(Ne22)*state.rho - screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(Ne22)*state.rho; + jac.set(Ne22, H1, scratch); + + scratch = screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(F19)*state.rho + screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(O18)*state.rho; + jac.set(Ne22, He4, scratch); + + jac.set(Ne22, C12, 0.0); + + jac.set(Ne22, C13, 0.0); + + jac.set(Ne22, C14, 0.0); + + jac.set(Ne22, N13, 0.0); + + jac.set(Ne22, N14, 0.0); + + jac.set(Ne22, N15, 0.0); + + jac.set(Ne22, O16, 0.0); + + jac.set(Ne22, O17, 0.0); + + scratch = screened_rates(k_He4_O18_to_Ne22_reaclib)*Y(He4)*state.rho; + jac.set(Ne22, O18, scratch); + + jac.set(Ne22, F18, 0.0); + + scratch = screened_rates(k_He4_F19_to_p_Ne22_reaclib)*Y(He4)*state.rho; + jac.set(Ne22, F19, scratch); + + jac.set(Ne22, Ne20, 0.0); + + jac.set(Ne22, Ne21, 0.0); + + scratch = -screened_rates(k_Ne22_to_He4_O18_derived) - screened_rates(k_Ne22_to_Na22_weaktab) - screened_rates(k_p_Ne22_to_He4_F19_derived)*Y(H1)*state.rho - screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(H1)*state.rho; + jac.set(Ne22, Ne22, scratch); + + scratch = screened_rates(k_Na22_to_Ne22_weaktab); + jac.set(Ne22, Na22, scratch); + + scratch = screened_rates(k_Na23_to_p_Ne22_derived); + jac.set(Ne22, Na23, scratch); + + jac.set(Ne22, Mg24, 0.0); + + jac.set(Ne22, Mg25, 0.0); + + jac.set(Ne22, Al26, 0.0); + + jac.set(Ne22, Al27, 0.0); + + jac.set(Ne22, Si28, 0.0); + + jac.set(Ne22, Si29, 0.0); + + jac.set(Ne22, P30, 0.0); + + jac.set(Ne22, P31, 0.0); + + jac.set(Ne22, S32, 0.0); + + jac.set(Ne22, S33, 0.0); + + jac.set(Ne22, Cl34, 0.0); + + jac.set(Ne22, Cl35, 0.0); + + jac.set(Ne22, Ar36, 0.0); + + jac.set(Ne22, Ar37, 0.0); + + jac.set(Ne22, K38, 0.0); + + jac.set(Ne22, K39, 0.0); + + jac.set(Ne22, Ca40, 0.0); + + jac.set(Ne22, Ca41, 0.0); + + jac.set(Ne22, Sc42, 0.0); + + jac.set(Ne22, Sc43, 0.0); + + jac.set(Ne22, Ti44, 0.0); + + jac.set(Ne22, Ti45, 0.0); + + jac.set(Ne22, V46, 0.0); + + jac.set(Ne22, V47, 0.0); + + jac.set(Ne22, Cr48, 0.0); + + jac.set(Ne22, Cr49, 0.0); + + jac.set(Ne22, Mn50, 0.0); + + jac.set(Ne22, Mn51, 0.0); + + jac.set(Ne22, Mn52, 0.0); + + jac.set(Ne22, Fe52, 0.0); + + jac.set(Ne22, Fe53, 0.0); + + jac.set(Ne22, Fe54, 0.0); + + jac.set(Ne22, Fe55, 0.0); + + jac.set(Ne22, Fe56, 0.0); + + jac.set(Ne22, Co55, 0.0); + + jac.set(Ne22, Co56, 0.0); + + jac.set(Ne22, Co57, 0.0); + + jac.set(Ne22, Ni56, 0.0); + + jac.set(Ne22, Ni57, 0.0); + + jac.set(Ne22, Ni58, 0.0); + + jac.set(Ne22, Cu59, 0.0); + + jac.set(Ne22, Zn60, 0.0); + + jac.set(Na22, N, 0.0); + + scratch = screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*state.rho + screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(Ne21)*state.rho; + jac.set(Na22, H1, scratch); + + scratch = screened_rates(k_He4_F18_to_Na22_reaclib)*Y(F18)*state.rho - screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(Na22)*state.rho - screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(Na22)*state.rho; + jac.set(Na22, He4, scratch); + + jac.set(Na22, C12, 0.0); + + jac.set(Na22, C13, 0.0); + + jac.set(Na22, C14, 0.0); + + jac.set(Na22, N13, 0.0); + + jac.set(Na22, N14, 0.0); + + jac.set(Na22, N15, 0.0); + + jac.set(Na22, O16, 0.0); + + jac.set(Na22, O17, 0.0); + + jac.set(Na22, O18, 0.0); + + scratch = screened_rates(k_He4_F18_to_Na22_reaclib)*Y(He4)*state.rho; + jac.set(Na22, F18, scratch); + + jac.set(Na22, F19, 0.0); + + jac.set(Na22, Ne20, 0.0); + + scratch = screened_rates(k_p_Ne21_to_Na22_reaclib)*Y(H1)*state.rho; + jac.set(Na22, Ne21, scratch); + + scratch = screened_rates(k_Ne22_to_Na22_weaktab); + jac.set(Na22, Ne22, scratch); + + scratch = -screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*state.rho - screened_rates(k_Na22_to_He4_F18_derived) - screened_rates(k_Na22_to_Ne22_weaktab) - screened_rates(k_Na22_to_p_Ne21_derived); + jac.set(Na22, Na22, scratch); + + jac.set(Na22, Na23, 0.0); + + jac.set(Na22, Mg24, 0.0); + + scratch = screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(H1)*state.rho; + jac.set(Na22, Mg25, scratch); + + scratch = screened_rates(k_Al26_to_He4_Na22_derived); + jac.set(Na22, Al26, scratch); + + jac.set(Na22, Al27, 0.0); + + jac.set(Na22, Si28, 0.0); + + jac.set(Na22, Si29, 0.0); + + jac.set(Na22, P30, 0.0); + + jac.set(Na22, P31, 0.0); + + jac.set(Na22, S32, 0.0); + + jac.set(Na22, S33, 0.0); + + jac.set(Na22, Cl34, 0.0); + + jac.set(Na22, Cl35, 0.0); + + jac.set(Na22, Ar36, 0.0); + + jac.set(Na22, Ar37, 0.0); + + jac.set(Na22, K38, 0.0); + + jac.set(Na22, K39, 0.0); + + jac.set(Na22, Ca40, 0.0); + + jac.set(Na22, Ca41, 0.0); + + jac.set(Na22, Sc42, 0.0); + + jac.set(Na22, Sc43, 0.0); + + jac.set(Na22, Ti44, 0.0); + + jac.set(Na22, Ti45, 0.0); + + jac.set(Na22, V46, 0.0); + + jac.set(Na22, V47, 0.0); + + jac.set(Na22, Cr48, 0.0); + + jac.set(Na22, Cr49, 0.0); + + jac.set(Na22, Mn50, 0.0); + + jac.set(Na22, Mn51, 0.0); + + jac.set(Na22, Mn52, 0.0); + + jac.set(Na22, Fe52, 0.0); + + jac.set(Na22, Fe53, 0.0); + + jac.set(Na22, Fe54, 0.0); + + jac.set(Na22, Fe55, 0.0); + + jac.set(Na22, Fe56, 0.0); + + jac.set(Na22, Co55, 0.0); + + jac.set(Na22, Co56, 0.0); + + jac.set(Na22, Co57, 0.0); + + jac.set(Na22, Ni56, 0.0); + + jac.set(Na22, Ni57, 0.0); + + jac.set(Na22, Ni58, 0.0); + + jac.set(Na22, Cu59, 0.0); + + jac.set(Na22, Zn60, 0.0); + + jac.set(Na23, N, 0.0); + + scratch = -screened_rates(k_p_Na23_to_C12_C12_derived)*Y(Na23)*state.rho - screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(Na23)*state.rho - screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(Na23)*state.rho + screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(Ne22)*state.rho; + jac.set(Na23, H1, scratch); + + scratch = screened_rates(k_He4_F19_to_Na23_reaclib)*Y(F19)*state.rho - screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(Na23)*state.rho + screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(Ne20)*state.rho; + jac.set(Na23, He4, scratch); + + scratch = 1.0*screened_rates(k_C12_C12_to_p_Na23_reaclib)*Y(C12)*state.rho; + jac.set(Na23, C12, scratch); + + jac.set(Na23, C13, 0.0); + + jac.set(Na23, C14, 0.0); + + jac.set(Na23, N13, 0.0); + + jac.set(Na23, N14, 0.0); + + jac.set(Na23, N15, 0.0); + + jac.set(Na23, O16, 0.0); + + jac.set(Na23, O17, 0.0); + + jac.set(Na23, O18, 0.0); + + jac.set(Na23, F18, 0.0); + + scratch = screened_rates(k_He4_F19_to_Na23_reaclib)*Y(He4)*state.rho; + jac.set(Na23, F19, scratch); + + scratch = screened_rates(k_He4_Ne20_to_p_Na23_derived)*Y(He4)*state.rho; + jac.set(Na23, Ne20, scratch); + + jac.set(Na23, Ne21, 0.0); + + scratch = screened_rates(k_p_Ne22_to_Na23_reaclib)*Y(H1)*state.rho; + jac.set(Na23, Ne22, scratch); + + jac.set(Na23, Na22, 0.0); + + scratch = -screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(He4)*state.rho - screened_rates(k_Na23_to_He4_F19_derived) - screened_rates(k_Na23_to_p_Ne22_derived) - screened_rates(k_p_Na23_to_C12_C12_derived)*Y(H1)*state.rho - screened_rates(k_p_Na23_to_He4_Ne20_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(H1)*state.rho; + jac.set(Na23, Na23, scratch); + + scratch = screened_rates(k_Mg24_to_p_Na23_derived); + jac.set(Na23, Mg24, scratch); + + jac.set(Na23, Mg25, 0.0); + + jac.set(Na23, Al26, 0.0); + + scratch = screened_rates(k_Al27_to_He4_Na23_derived); + jac.set(Na23, Al27, scratch); + + jac.set(Na23, Si28, 0.0); + + jac.set(Na23, Si29, 0.0); + + jac.set(Na23, P30, 0.0); + + jac.set(Na23, P31, 0.0); + + jac.set(Na23, S32, 0.0); + + jac.set(Na23, S33, 0.0); + + jac.set(Na23, Cl34, 0.0); + + jac.set(Na23, Cl35, 0.0); + + jac.set(Na23, Ar36, 0.0); + + jac.set(Na23, Ar37, 0.0); + + jac.set(Na23, K38, 0.0); + + jac.set(Na23, K39, 0.0); + + jac.set(Na23, Ca40, 0.0); + + jac.set(Na23, Ca41, 0.0); + + jac.set(Na23, Sc42, 0.0); + + jac.set(Na23, Sc43, 0.0); + + jac.set(Na23, Ti44, 0.0); + + jac.set(Na23, Ti45, 0.0); + + jac.set(Na23, V46, 0.0); + + jac.set(Na23, V47, 0.0); + + jac.set(Na23, Cr48, 0.0); + + jac.set(Na23, Cr49, 0.0); + + jac.set(Na23, Mn50, 0.0); + + jac.set(Na23, Mn51, 0.0); + + jac.set(Na23, Mn52, 0.0); + + jac.set(Na23, Fe52, 0.0); + + jac.set(Na23, Fe53, 0.0); + + jac.set(Na23, Fe54, 0.0); + + jac.set(Na23, Fe55, 0.0); + + jac.set(Na23, Fe56, 0.0); + + jac.set(Na23, Co55, 0.0); + + jac.set(Na23, Co56, 0.0); + + jac.set(Na23, Co57, 0.0); + + jac.set(Na23, Ni56, 0.0); + + jac.set(Na23, Ni57, 0.0); + + jac.set(Na23, Ni58, 0.0); + + jac.set(Na23, Cu59, 0.0); + + jac.set(Na23, Zn60, 0.0); + + jac.set(Mg24, N, 0.0); + + scratch = screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*state.rho + screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(Na23)*state.rho; + jac.set(Mg24, H1, scratch); + + scratch = -screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(Mg24)*state.rho - screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(Mg24)*state.rho - screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(Mg24)*state.rho + screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(Ne20)*state.rho; + jac.set(Mg24, He4, scratch); + + scratch = screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(O16)*state.rho; + jac.set(Mg24, C12, scratch); + + jac.set(Mg24, C13, 0.0); + + jac.set(Mg24, C14, 0.0); + + jac.set(Mg24, N13, 0.0); + + jac.set(Mg24, N14, 0.0); + + jac.set(Mg24, N15, 0.0); + + scratch = screened_rates(k_C12_O16_to_He4_Mg24_reaclib)*Y(C12)*state.rho; + jac.set(Mg24, O16, scratch); + + jac.set(Mg24, O17, 0.0); + + jac.set(Mg24, O18, 0.0); + + jac.set(Mg24, F18, 0.0); + + jac.set(Mg24, F19, 0.0); + + scratch = screened_rates(k_He4_Ne20_to_Mg24_reaclib)*Y(He4)*state.rho; + jac.set(Mg24, Ne20, scratch); + + jac.set(Mg24, Ne21, 0.0); + + jac.set(Mg24, Ne22, 0.0); + + jac.set(Mg24, Na22, 0.0); + + scratch = screened_rates(k_p_Na23_to_Mg24_reaclib)*Y(H1)*state.rho; + jac.set(Mg24, Na23, scratch); + + scratch = -screened_rates(k_He4_Mg24_to_C12_O16_derived)*Y(He4)*state.rho - screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*state.rho - screened_rates(k_Mg24_to_He4_Ne20_derived) - screened_rates(k_Mg24_to_p_Na23_derived); + jac.set(Mg24, Mg24, scratch); + + jac.set(Mg24, Mg25, 0.0); + + jac.set(Mg24, Al26, 0.0); + + scratch = screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(H1)*state.rho; + jac.set(Mg24, Al27, scratch); + + scratch = screened_rates(k_Si28_to_He4_Mg24_derived); + jac.set(Mg24, Si28, scratch); + + jac.set(Mg24, Si29, 0.0); + + jac.set(Mg24, P30, 0.0); + + jac.set(Mg24, P31, 0.0); + + jac.set(Mg24, S32, 0.0); + + jac.set(Mg24, S33, 0.0); + + jac.set(Mg24, Cl34, 0.0); + + jac.set(Mg24, Cl35, 0.0); + + jac.set(Mg24, Ar36, 0.0); + + jac.set(Mg24, Ar37, 0.0); + + jac.set(Mg24, K38, 0.0); + + jac.set(Mg24, K39, 0.0); + + jac.set(Mg24, Ca40, 0.0); + + jac.set(Mg24, Ca41, 0.0); + + jac.set(Mg24, Sc42, 0.0); + + jac.set(Mg24, Sc43, 0.0); + + jac.set(Mg24, Ti44, 0.0); + + jac.set(Mg24, Ti45, 0.0); + + jac.set(Mg24, V46, 0.0); + + jac.set(Mg24, V47, 0.0); + + jac.set(Mg24, Cr48, 0.0); + + jac.set(Mg24, Cr49, 0.0); + + jac.set(Mg24, Mn50, 0.0); + + jac.set(Mg24, Mn51, 0.0); + + jac.set(Mg24, Mn52, 0.0); + + jac.set(Mg24, Fe52, 0.0); + + jac.set(Mg24, Fe53, 0.0); + + jac.set(Mg24, Fe54, 0.0); + + jac.set(Mg24, Fe55, 0.0); + + jac.set(Mg24, Fe56, 0.0); + + jac.set(Mg24, Co55, 0.0); + + jac.set(Mg24, Co56, 0.0); + + jac.set(Mg24, Co57, 0.0); + + jac.set(Mg24, Ni56, 0.0); + + jac.set(Mg24, Ni57, 0.0); + + jac.set(Mg24, Ni58, 0.0); + + jac.set(Mg24, Cu59, 0.0); + + jac.set(Mg24, Zn60, 0.0); + + jac.set(Mg25, N, 0.0); + + scratch = -screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(Mg25)*state.rho - screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(Mg25)*state.rho; + jac.set(Mg25, H1, scratch); + + scratch = -screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(Mg25)*state.rho + screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(Na22)*state.rho + screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(Ne21)*state.rho; + jac.set(Mg25, He4, scratch); + + jac.set(Mg25, C12, 0.0); + + jac.set(Mg25, C13, 0.0); + + jac.set(Mg25, C14, 0.0); + + jac.set(Mg25, N13, 0.0); + + jac.set(Mg25, N14, 0.0); + + jac.set(Mg25, N15, 0.0); + + jac.set(Mg25, O16, 0.0); + + jac.set(Mg25, O17, 0.0); + + jac.set(Mg25, O18, 0.0); + + jac.set(Mg25, F18, 0.0); + + jac.set(Mg25, F19, 0.0); + + jac.set(Mg25, Ne20, 0.0); + + scratch = screened_rates(k_He4_Ne21_to_Mg25_reaclib)*Y(He4)*state.rho; + jac.set(Mg25, Ne21, scratch); + + jac.set(Mg25, Ne22, 0.0); + + scratch = screened_rates(k_He4_Na22_to_p_Mg25_reaclib)*Y(He4)*state.rho; + jac.set(Mg25, Na22, scratch); + + jac.set(Mg25, Na23, 0.0); + + jac.set(Mg25, Mg24, 0.0); + + scratch = -screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(He4)*state.rho - screened_rates(k_Mg25_to_He4_Ne21_derived) - screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Mg25_to_He4_Na22_derived)*Y(H1)*state.rho; + jac.set(Mg25, Mg25, scratch); + + scratch = screened_rates(k_Al26_to_p_Mg25_derived); + jac.set(Mg25, Al26, scratch); + + jac.set(Mg25, Al27, 0.0); + + jac.set(Mg25, Si28, 0.0); + + scratch = screened_rates(k_Si29_to_He4_Mg25_derived); + jac.set(Mg25, Si29, scratch); + + jac.set(Mg25, P30, 0.0); + + jac.set(Mg25, P31, 0.0); + + jac.set(Mg25, S32, 0.0); + + jac.set(Mg25, S33, 0.0); + + jac.set(Mg25, Cl34, 0.0); + + jac.set(Mg25, Cl35, 0.0); + + jac.set(Mg25, Ar36, 0.0); + + jac.set(Mg25, Ar37, 0.0); + + jac.set(Mg25, K38, 0.0); + + jac.set(Mg25, K39, 0.0); + + jac.set(Mg25, Ca40, 0.0); + + jac.set(Mg25, Ca41, 0.0); + + jac.set(Mg25, Sc42, 0.0); + + jac.set(Mg25, Sc43, 0.0); + + jac.set(Mg25, Ti44, 0.0); + + jac.set(Mg25, Ti45, 0.0); + + jac.set(Mg25, V46, 0.0); + + jac.set(Mg25, V47, 0.0); + + jac.set(Mg25, Cr48, 0.0); + + jac.set(Mg25, Cr49, 0.0); + + jac.set(Mg25, Mn50, 0.0); + + jac.set(Mg25, Mn51, 0.0); + + jac.set(Mg25, Mn52, 0.0); + + jac.set(Mg25, Fe52, 0.0); + + jac.set(Mg25, Fe53, 0.0); + + jac.set(Mg25, Fe54, 0.0); + + jac.set(Mg25, Fe55, 0.0); + + jac.set(Mg25, Fe56, 0.0); + + jac.set(Mg25, Co55, 0.0); + + jac.set(Mg25, Co56, 0.0); + + jac.set(Mg25, Co57, 0.0); + + jac.set(Mg25, Ni56, 0.0); + + jac.set(Mg25, Ni57, 0.0); + + jac.set(Mg25, Ni58, 0.0); + + jac.set(Mg25, Cu59, 0.0); + + jac.set(Mg25, Zn60, 0.0); + + jac.set(Al26, N, 0.0); + + scratch = screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(Mg25)*state.rho + screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*state.rho; + jac.set(Al26, H1, scratch); + + scratch = -screened_rates(k_He4_Al26_to_P30_reaclib)*Y(Al26)*state.rho - screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*state.rho + screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(Na22)*state.rho; + jac.set(Al26, He4, scratch); + + jac.set(Al26, C12, 0.0); + + jac.set(Al26, C13, 0.0); + + jac.set(Al26, C14, 0.0); + + jac.set(Al26, N13, 0.0); + + jac.set(Al26, N14, 0.0); + + jac.set(Al26, N15, 0.0); + + jac.set(Al26, O16, 0.0); + + jac.set(Al26, O17, 0.0); + + jac.set(Al26, O18, 0.0); + + jac.set(Al26, F18, 0.0); + + jac.set(Al26, F19, 0.0); + + jac.set(Al26, Ne20, 0.0); + + jac.set(Al26, Ne21, 0.0); + + jac.set(Al26, Ne22, 0.0); + + scratch = screened_rates(k_He4_Na22_to_Al26_reaclib)*Y(He4)*state.rho; + jac.set(Al26, Na22, scratch); + + jac.set(Al26, Na23, 0.0); + + jac.set(Al26, Mg24, 0.0); + + scratch = screened_rates(k_p_Mg25_to_Al26_reaclib)*Y(H1)*state.rho; + jac.set(Al26, Mg25, scratch); + + scratch = -screened_rates(k_Al26_to_He4_Na22_derived) - screened_rates(k_Al26_to_p_Mg25_derived) - screened_rates(k_He4_Al26_to_P30_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(He4)*state.rho; + jac.set(Al26, Al26, scratch); + + jac.set(Al26, Al27, 0.0); + + jac.set(Al26, Si28, 0.0); + + scratch = screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(H1)*state.rho; + jac.set(Al26, Si29, scratch); + + scratch = screened_rates(k_P30_to_He4_Al26_derived); + jac.set(Al26, P30, scratch); + + jac.set(Al26, P31, 0.0); + + jac.set(Al26, S32, 0.0); + + jac.set(Al26, S33, 0.0); + + jac.set(Al26, Cl34, 0.0); + + jac.set(Al26, Cl35, 0.0); + + jac.set(Al26, Ar36, 0.0); + + jac.set(Al26, Ar37, 0.0); + + jac.set(Al26, K38, 0.0); + + jac.set(Al26, K39, 0.0); + + jac.set(Al26, Ca40, 0.0); + + jac.set(Al26, Ca41, 0.0); + + jac.set(Al26, Sc42, 0.0); + + jac.set(Al26, Sc43, 0.0); + + jac.set(Al26, Ti44, 0.0); + + jac.set(Al26, Ti45, 0.0); + + jac.set(Al26, V46, 0.0); + + jac.set(Al26, V47, 0.0); + + jac.set(Al26, Cr48, 0.0); + + jac.set(Al26, Cr49, 0.0); + + jac.set(Al26, Mn50, 0.0); + + jac.set(Al26, Mn51, 0.0); + + jac.set(Al26, Mn52, 0.0); + + jac.set(Al26, Fe52, 0.0); + + jac.set(Al26, Fe53, 0.0); + + jac.set(Al26, Fe54, 0.0); + + jac.set(Al26, Fe55, 0.0); + + jac.set(Al26, Fe56, 0.0); + + jac.set(Al26, Co55, 0.0); + + jac.set(Al26, Co56, 0.0); + + jac.set(Al26, Co57, 0.0); + + jac.set(Al26, Ni56, 0.0); + + jac.set(Al26, Ni57, 0.0); + + jac.set(Al26, Ni58, 0.0); + + jac.set(Al26, Cu59, 0.0); + + jac.set(Al26, Zn60, 0.0); + + jac.set(Al27, N, 0.0); + + scratch = -screened_rates(k_p_Al27_to_C12_O16_derived)*Y(Al27)*state.rho - screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(Al27)*state.rho - screened_rates(k_p_Al27_to_Si28_reaclib)*Y(Al27)*state.rho; + jac.set(Al27, H1, scratch); + + scratch = -screened_rates(k_He4_Al27_to_P31_reaclib)*Y(Al27)*state.rho + screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(Mg24)*state.rho + screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(Na23)*state.rho; + jac.set(Al27, He4, scratch); + + scratch = screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(O16)*state.rho; + jac.set(Al27, C12, scratch); + + jac.set(Al27, C13, 0.0); + + jac.set(Al27, C14, 0.0); + + jac.set(Al27, N13, 0.0); + + jac.set(Al27, N14, 0.0); + + jac.set(Al27, N15, 0.0); + + scratch = screened_rates(k_C12_O16_to_p_Al27_reaclib)*Y(C12)*state.rho; + jac.set(Al27, O16, scratch); + + jac.set(Al27, O17, 0.0); + + jac.set(Al27, O18, 0.0); + + jac.set(Al27, F18, 0.0); + + jac.set(Al27, F19, 0.0); + + jac.set(Al27, Ne20, 0.0); + + jac.set(Al27, Ne21, 0.0); + + jac.set(Al27, Ne22, 0.0); + + jac.set(Al27, Na22, 0.0); + + scratch = screened_rates(k_He4_Na23_to_Al27_reaclib)*Y(He4)*state.rho; + jac.set(Al27, Na23, scratch); + + scratch = screened_rates(k_He4_Mg24_to_p_Al27_derived)*Y(He4)*state.rho; + jac.set(Al27, Mg24, scratch); + + jac.set(Al27, Mg25, 0.0); + + jac.set(Al27, Al26, 0.0); + + scratch = -screened_rates(k_Al27_to_He4_Na23_derived) - screened_rates(k_He4_Al27_to_P31_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Al27_to_C12_O16_derived)*Y(H1)*state.rho - screened_rates(k_p_Al27_to_He4_Mg24_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Al27_to_Si28_reaclib)*Y(H1)*state.rho; + jac.set(Al27, Al27, scratch); + + scratch = screened_rates(k_Si28_to_p_Al27_derived); + jac.set(Al27, Si28, scratch); + + jac.set(Al27, Si29, 0.0); + + jac.set(Al27, P30, 0.0); + + scratch = screened_rates(k_P31_to_He4_Al27_derived); + jac.set(Al27, P31, scratch); + + jac.set(Al27, S32, 0.0); + + jac.set(Al27, S33, 0.0); + + jac.set(Al27, Cl34, 0.0); + + jac.set(Al27, Cl35, 0.0); + + jac.set(Al27, Ar36, 0.0); + + jac.set(Al27, Ar37, 0.0); + + jac.set(Al27, K38, 0.0); + + jac.set(Al27, K39, 0.0); + + jac.set(Al27, Ca40, 0.0); + + jac.set(Al27, Ca41, 0.0); + + jac.set(Al27, Sc42, 0.0); + + jac.set(Al27, Sc43, 0.0); + + jac.set(Al27, Ti44, 0.0); + + jac.set(Al27, Ti45, 0.0); + + jac.set(Al27, V46, 0.0); + + jac.set(Al27, V47, 0.0); + + jac.set(Al27, Cr48, 0.0); + + jac.set(Al27, Cr49, 0.0); + + jac.set(Al27, Mn50, 0.0); + + jac.set(Al27, Mn51, 0.0); + + jac.set(Al27, Mn52, 0.0); + + jac.set(Al27, Fe52, 0.0); + + jac.set(Al27, Fe53, 0.0); + + jac.set(Al27, Fe54, 0.0); + + jac.set(Al27, Fe55, 0.0); + + jac.set(Al27, Fe56, 0.0); + + jac.set(Al27, Co55, 0.0); + + jac.set(Al27, Co56, 0.0); + + jac.set(Al27, Co57, 0.0); + + jac.set(Al27, Ni56, 0.0); + + jac.set(Al27, Ni57, 0.0); + + jac.set(Al27, Ni58, 0.0); + + jac.set(Al27, Cu59, 0.0); + + jac.set(Al27, Zn60, 0.0); + + jac.set(Si28, N, 0.0); + + scratch = screened_rates(k_p_Al27_to_Si28_reaclib)*Y(Al27)*state.rho + screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*state.rho; + jac.set(Si28, H1, scratch); + + scratch = screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(Mg24)*state.rho - screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(Si28)*state.rho - screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(Si28)*state.rho - screened_rates(k_He4_Si28_to_S32_reaclib)*Y(Si28)*state.rho - screened_rates(k_He4_Si28_to_p_P31_derived)*Y(Si28)*state.rho; + jac.set(Si28, He4, scratch); + + scratch = screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(Ne20)*state.rho; + jac.set(Si28, C12, scratch); + + jac.set(Si28, C13, 0.0); + + jac.set(Si28, C14, 0.0); + + jac.set(Si28, N13, 0.0); + + jac.set(Si28, N14, 0.0); + + jac.set(Si28, N15, 0.0); + + scratch = 1.0*screened_rates(k_O16_O16_to_He4_Si28_reaclib)*Y(O16)*state.rho; + jac.set(Si28, O16, scratch); + + jac.set(Si28, O17, 0.0); + + jac.set(Si28, O18, 0.0); + + jac.set(Si28, F18, 0.0); + + jac.set(Si28, F19, 0.0); + + scratch = screened_rates(k_C12_Ne20_to_He4_Si28_reaclib)*Y(C12)*state.rho; + jac.set(Si28, Ne20, scratch); + + jac.set(Si28, Ne21, 0.0); + + jac.set(Si28, Ne22, 0.0); + + jac.set(Si28, Na22, 0.0); + + jac.set(Si28, Na23, 0.0); + + scratch = screened_rates(k_He4_Mg24_to_Si28_reaclib)*Y(He4)*state.rho; + jac.set(Si28, Mg24, scratch); + + jac.set(Si28, Mg25, 0.0); + + jac.set(Si28, Al26, 0.0); + + scratch = screened_rates(k_p_Al27_to_Si28_reaclib)*Y(H1)*state.rho; + jac.set(Si28, Al27, scratch); + + scratch = -screened_rates(k_He4_Si28_to_C12_Ne20_derived)*Y(He4)*state.rho - screened_rates(k_He4_Si28_to_O16_O16_derived)*Y(He4)*state.rho - screened_rates(k_He4_Si28_to_S32_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*state.rho - screened_rates(k_Si28_to_He4_Mg24_derived) - screened_rates(k_Si28_to_p_Al27_derived); + jac.set(Si28, Si28, scratch); + + jac.set(Si28, Si29, 0.0); + + jac.set(Si28, P30, 0.0); + + scratch = screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(H1)*state.rho; + jac.set(Si28, P31, scratch); + + scratch = screened_rates(k_S32_to_He4_Si28_derived); + jac.set(Si28, S32, scratch); + + jac.set(Si28, S33, 0.0); + + jac.set(Si28, Cl34, 0.0); + + jac.set(Si28, Cl35, 0.0); + + jac.set(Si28, Ar36, 0.0); + + jac.set(Si28, Ar37, 0.0); + + jac.set(Si28, K38, 0.0); + + jac.set(Si28, K39, 0.0); + + jac.set(Si28, Ca40, 0.0); + + jac.set(Si28, Ca41, 0.0); + + jac.set(Si28, Sc42, 0.0); + + jac.set(Si28, Sc43, 0.0); + + jac.set(Si28, Ti44, 0.0); + + jac.set(Si28, Ti45, 0.0); + + jac.set(Si28, V46, 0.0); + + jac.set(Si28, V47, 0.0); + + jac.set(Si28, Cr48, 0.0); + + jac.set(Si28, Cr49, 0.0); + + jac.set(Si28, Mn50, 0.0); + + jac.set(Si28, Mn51, 0.0); + + jac.set(Si28, Mn52, 0.0); + + jac.set(Si28, Fe52, 0.0); + + jac.set(Si28, Fe53, 0.0); + + jac.set(Si28, Fe54, 0.0); + + jac.set(Si28, Fe55, 0.0); + + jac.set(Si28, Fe56, 0.0); + + jac.set(Si28, Co55, 0.0); + + jac.set(Si28, Co56, 0.0); + + jac.set(Si28, Co57, 0.0); + + jac.set(Si28, Ni56, 0.0); + + jac.set(Si28, Ni57, 0.0); + + jac.set(Si28, Ni58, 0.0); + + jac.set(Si28, Cu59, 0.0); + + jac.set(Si28, Zn60, 0.0); + + jac.set(Si29, N, 0.0); + + scratch = -screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(Si29)*state.rho - screened_rates(k_p_Si29_to_P30_reaclib)*Y(Si29)*state.rho; + jac.set(Si29, H1, scratch); + + scratch = screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(Al26)*state.rho + screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(Mg25)*state.rho - screened_rates(k_He4_Si29_to_S33_reaclib)*Y(Si29)*state.rho; + jac.set(Si29, He4, scratch); + + jac.set(Si29, C12, 0.0); + + jac.set(Si29, C13, 0.0); + + jac.set(Si29, C14, 0.0); + + jac.set(Si29, N13, 0.0); + + jac.set(Si29, N14, 0.0); + + jac.set(Si29, N15, 0.0); + + jac.set(Si29, O16, 0.0); + + jac.set(Si29, O17, 0.0); + + jac.set(Si29, O18, 0.0); + + jac.set(Si29, F18, 0.0); + + jac.set(Si29, F19, 0.0); + + jac.set(Si29, Ne20, 0.0); + + jac.set(Si29, Ne21, 0.0); + + jac.set(Si29, Ne22, 0.0); + + jac.set(Si29, Na22, 0.0); + + jac.set(Si29, Na23, 0.0); + + jac.set(Si29, Mg24, 0.0); + + scratch = screened_rates(k_He4_Mg25_to_Si29_reaclib)*Y(He4)*state.rho; + jac.set(Si29, Mg25, scratch); + + scratch = screened_rates(k_He4_Al26_to_p_Si29_reaclib)*Y(He4)*state.rho; + jac.set(Si29, Al26, scratch); + + jac.set(Si29, Al27, 0.0); + + jac.set(Si29, Si28, 0.0); + + scratch = -screened_rates(k_He4_Si29_to_S33_reaclib)*Y(He4)*state.rho - screened_rates(k_Si29_to_He4_Mg25_derived) - screened_rates(k_p_Si29_to_He4_Al26_derived)*Y(H1)*state.rho - screened_rates(k_p_Si29_to_P30_reaclib)*Y(H1)*state.rho; + jac.set(Si29, Si29, scratch); + + scratch = screened_rates(k_P30_to_p_Si29_derived); + jac.set(Si29, P30, scratch); + + jac.set(Si29, P31, 0.0); + + jac.set(Si29, S32, 0.0); + + scratch = screened_rates(k_S33_to_He4_Si29_derived); + jac.set(Si29, S33, scratch); + + jac.set(Si29, Cl34, 0.0); + + jac.set(Si29, Cl35, 0.0); + + jac.set(Si29, Ar36, 0.0); + + jac.set(Si29, Ar37, 0.0); + + jac.set(Si29, K38, 0.0); + + jac.set(Si29, K39, 0.0); + + jac.set(Si29, Ca40, 0.0); + + jac.set(Si29, Ca41, 0.0); + + jac.set(Si29, Sc42, 0.0); + + jac.set(Si29, Sc43, 0.0); + + jac.set(Si29, Ti44, 0.0); + + jac.set(Si29, Ti45, 0.0); + + jac.set(Si29, V46, 0.0); + + jac.set(Si29, V47, 0.0); + + jac.set(Si29, Cr48, 0.0); + + jac.set(Si29, Cr49, 0.0); + + jac.set(Si29, Mn50, 0.0); + + jac.set(Si29, Mn51, 0.0); + + jac.set(Si29, Mn52, 0.0); + + jac.set(Si29, Fe52, 0.0); + + jac.set(Si29, Fe53, 0.0); + + jac.set(Si29, Fe54, 0.0); + + jac.set(Si29, Fe55, 0.0); + + jac.set(Si29, Fe56, 0.0); + + jac.set(Si29, Co55, 0.0); + + jac.set(Si29, Co56, 0.0); + + jac.set(Si29, Co57, 0.0); + + jac.set(Si29, Ni56, 0.0); + + jac.set(Si29, Ni57, 0.0); + + jac.set(Si29, Ni58, 0.0); + + jac.set(Si29, Cu59, 0.0); + + jac.set(Si29, Zn60, 0.0); + + jac.set(P30, N, 0.0); + + scratch = screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*state.rho + screened_rates(k_p_Si29_to_P30_reaclib)*Y(Si29)*state.rho; + jac.set(P30, H1, scratch); + + scratch = screened_rates(k_He4_Al26_to_P30_reaclib)*Y(Al26)*state.rho - screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(P30)*state.rho - screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(P30)*state.rho; + jac.set(P30, He4, scratch); + + jac.set(P30, C12, 0.0); + + jac.set(P30, C13, 0.0); + + jac.set(P30, C14, 0.0); + + jac.set(P30, N13, 0.0); + + jac.set(P30, N14, 0.0); + + jac.set(P30, N15, 0.0); + + jac.set(P30, O16, 0.0); + + jac.set(P30, O17, 0.0); + + jac.set(P30, O18, 0.0); + + jac.set(P30, F18, 0.0); + + jac.set(P30, F19, 0.0); + + jac.set(P30, Ne20, 0.0); + + jac.set(P30, Ne21, 0.0); + + jac.set(P30, Ne22, 0.0); + + jac.set(P30, Na22, 0.0); + + jac.set(P30, Na23, 0.0); + + jac.set(P30, Mg24, 0.0); + + jac.set(P30, Mg25, 0.0); + + scratch = screened_rates(k_He4_Al26_to_P30_reaclib)*Y(He4)*state.rho; + jac.set(P30, Al26, scratch); + + jac.set(P30, Al27, 0.0); + + jac.set(P30, Si28, 0.0); + + scratch = screened_rates(k_p_Si29_to_P30_reaclib)*Y(H1)*state.rho; + jac.set(P30, Si29, scratch); + + scratch = -screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*state.rho - screened_rates(k_P30_to_He4_Al26_derived) - screened_rates(k_P30_to_p_Si29_derived); + jac.set(P30, P30, scratch); + + jac.set(P30, P31, 0.0); + + jac.set(P30, S32, 0.0); + + scratch = screened_rates(k_p_S33_to_He4_P30_derived)*Y(H1)*state.rho; + jac.set(P30, S33, scratch); + + scratch = screened_rates(k_Cl34_to_He4_P30_derived); + jac.set(P30, Cl34, scratch); + + jac.set(P30, Cl35, 0.0); + + jac.set(P30, Ar36, 0.0); + + jac.set(P30, Ar37, 0.0); + + jac.set(P30, K38, 0.0); + + jac.set(P30, K39, 0.0); + + jac.set(P30, Ca40, 0.0); + + jac.set(P30, Ca41, 0.0); + + jac.set(P30, Sc42, 0.0); + + jac.set(P30, Sc43, 0.0); + + jac.set(P30, Ti44, 0.0); + + jac.set(P30, Ti45, 0.0); + + jac.set(P30, V46, 0.0); + + jac.set(P30, V47, 0.0); + + jac.set(P30, Cr48, 0.0); + + jac.set(P30, Cr49, 0.0); + + jac.set(P30, Mn50, 0.0); + + jac.set(P30, Mn51, 0.0); + + jac.set(P30, Mn52, 0.0); + + jac.set(P30, Fe52, 0.0); + + jac.set(P30, Fe53, 0.0); + + jac.set(P30, Fe54, 0.0); + + jac.set(P30, Fe55, 0.0); + + jac.set(P30, Fe56, 0.0); + + jac.set(P30, Co55, 0.0); + + jac.set(P30, Co56, 0.0); + + jac.set(P30, Co57, 0.0); + + jac.set(P30, Ni56, 0.0); + + jac.set(P30, Ni57, 0.0); + + jac.set(P30, Ni58, 0.0); + + jac.set(P30, Cu59, 0.0); + + jac.set(P30, Zn60, 0.0); + + jac.set(P31, N, 0.0); + + scratch = -screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(P31)*state.rho - screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(P31)*state.rho - screened_rates(k_p_P31_to_O16_O16_derived)*Y(P31)*state.rho - screened_rates(k_p_P31_to_S32_reaclib)*Y(P31)*state.rho; + jac.set(P31, H1, scratch); + + scratch = screened_rates(k_He4_Al27_to_P31_reaclib)*Y(Al27)*state.rho - screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(P31)*state.rho + screened_rates(k_He4_Si28_to_p_P31_derived)*Y(Si28)*state.rho; + jac.set(P31, He4, scratch); + + scratch = screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(Ne20)*state.rho; + jac.set(P31, C12, scratch); + + jac.set(P31, C13, 0.0); + + jac.set(P31, C14, 0.0); + + jac.set(P31, N13, 0.0); + + jac.set(P31, N14, 0.0); + + jac.set(P31, N15, 0.0); + + scratch = 1.0*screened_rates(k_O16_O16_to_p_P31_reaclib)*Y(O16)*state.rho; + jac.set(P31, O16, scratch); + + jac.set(P31, O17, 0.0); + + jac.set(P31, O18, 0.0); + + jac.set(P31, F18, 0.0); + + jac.set(P31, F19, 0.0); + + scratch = screened_rates(k_C12_Ne20_to_p_P31_reaclib)*Y(C12)*state.rho; + jac.set(P31, Ne20, scratch); + + jac.set(P31, Ne21, 0.0); + + jac.set(P31, Ne22, 0.0); + + jac.set(P31, Na22, 0.0); + + jac.set(P31, Na23, 0.0); + + jac.set(P31, Mg24, 0.0); + + jac.set(P31, Mg25, 0.0); + + jac.set(P31, Al26, 0.0); + + scratch = screened_rates(k_He4_Al27_to_P31_reaclib)*Y(He4)*state.rho; + jac.set(P31, Al27, scratch); + + scratch = screened_rates(k_He4_Si28_to_p_P31_derived)*Y(He4)*state.rho; + jac.set(P31, Si28, scratch); + + jac.set(P31, Si29, 0.0); + + jac.set(P31, P30, 0.0); + + scratch = -screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(He4)*state.rho - screened_rates(k_P31_to_He4_Al27_derived) - screened_rates(k_p_P31_to_C12_Ne20_derived)*Y(H1)*state.rho - screened_rates(k_p_P31_to_He4_Si28_reaclib)*Y(H1)*state.rho - screened_rates(k_p_P31_to_O16_O16_derived)*Y(H1)*state.rho - screened_rates(k_p_P31_to_S32_reaclib)*Y(H1)*state.rho; + jac.set(P31, P31, scratch); + + scratch = screened_rates(k_S32_to_p_P31_derived); + jac.set(P31, S32, scratch); + + jac.set(P31, S33, 0.0); + + jac.set(P31, Cl34, 0.0); + + scratch = screened_rates(k_Cl35_to_He4_P31_derived); + jac.set(P31, Cl35, scratch); + + jac.set(P31, Ar36, 0.0); + + jac.set(P31, Ar37, 0.0); + + jac.set(P31, K38, 0.0); + + jac.set(P31, K39, 0.0); + + jac.set(P31, Ca40, 0.0); + + jac.set(P31, Ca41, 0.0); + + jac.set(P31, Sc42, 0.0); + + jac.set(P31, Sc43, 0.0); + + jac.set(P31, Ti44, 0.0); + + jac.set(P31, Ti45, 0.0); + + jac.set(P31, V46, 0.0); + + jac.set(P31, V47, 0.0); + + jac.set(P31, Cr48, 0.0); + + jac.set(P31, Cr49, 0.0); + + jac.set(P31, Mn50, 0.0); + + jac.set(P31, Mn51, 0.0); + + jac.set(P31, Mn52, 0.0); + + jac.set(P31, Fe52, 0.0); + + jac.set(P31, Fe53, 0.0); + + jac.set(P31, Fe54, 0.0); + + jac.set(P31, Fe55, 0.0); + + jac.set(P31, Fe56, 0.0); + + jac.set(P31, Co55, 0.0); + + jac.set(P31, Co56, 0.0); + + jac.set(P31, Co57, 0.0); + + jac.set(P31, Ni56, 0.0); + + jac.set(P31, Ni57, 0.0); + + jac.set(P31, Ni58, 0.0); + + jac.set(P31, Cu59, 0.0); + + jac.set(P31, Zn60, 0.0); + + jac.set(S32, N, 0.0); + + scratch = screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*state.rho + screened_rates(k_p_P31_to_S32_reaclib)*Y(P31)*state.rho; + jac.set(S32, H1, scratch); + + scratch = -screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(S32)*state.rho - screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(S32)*state.rho + screened_rates(k_He4_Si28_to_S32_reaclib)*Y(Si28)*state.rho; + jac.set(S32, He4, scratch); + + jac.set(S32, C12, 0.0); + + jac.set(S32, C13, 0.0); + + jac.set(S32, C14, 0.0); + + jac.set(S32, N13, 0.0); + + jac.set(S32, N14, 0.0); + + jac.set(S32, N15, 0.0); + + jac.set(S32, O16, 0.0); + + jac.set(S32, O17, 0.0); + + jac.set(S32, O18, 0.0); + + jac.set(S32, F18, 0.0); + + jac.set(S32, F19, 0.0); + + jac.set(S32, Ne20, 0.0); + + jac.set(S32, Ne21, 0.0); + + jac.set(S32, Ne22, 0.0); + + jac.set(S32, Na22, 0.0); + + jac.set(S32, Na23, 0.0); + + jac.set(S32, Mg24, 0.0); + + jac.set(S32, Mg25, 0.0); + + jac.set(S32, Al26, 0.0); + + jac.set(S32, Al27, 0.0); + + scratch = screened_rates(k_He4_Si28_to_S32_reaclib)*Y(He4)*state.rho; + jac.set(S32, Si28, scratch); + + jac.set(S32, Si29, 0.0); + + jac.set(S32, P30, 0.0); + + scratch = screened_rates(k_p_P31_to_S32_reaclib)*Y(H1)*state.rho; + jac.set(S32, P31, scratch); + + scratch = -screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*state.rho - screened_rates(k_S32_to_He4_Si28_derived) - screened_rates(k_S32_to_p_P31_derived); + jac.set(S32, S32, scratch); + + jac.set(S32, S33, 0.0); + + jac.set(S32, Cl34, 0.0); + + scratch = screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(H1)*state.rho; + jac.set(S32, Cl35, scratch); + + scratch = screened_rates(k_Ar36_to_He4_S32_derived); + jac.set(S32, Ar36, scratch); + + jac.set(S32, Ar37, 0.0); + + jac.set(S32, K38, 0.0); + + jac.set(S32, K39, 0.0); + + jac.set(S32, Ca40, 0.0); + + jac.set(S32, Ca41, 0.0); + + jac.set(S32, Sc42, 0.0); + + jac.set(S32, Sc43, 0.0); + + jac.set(S32, Ti44, 0.0); + + jac.set(S32, Ti45, 0.0); + + jac.set(S32, V46, 0.0); + + jac.set(S32, V47, 0.0); + + jac.set(S32, Cr48, 0.0); + + jac.set(S32, Cr49, 0.0); + + jac.set(S32, Mn50, 0.0); + + jac.set(S32, Mn51, 0.0); + + jac.set(S32, Mn52, 0.0); + + jac.set(S32, Fe52, 0.0); + + jac.set(S32, Fe53, 0.0); + + jac.set(S32, Fe54, 0.0); + + jac.set(S32, Fe55, 0.0); + + jac.set(S32, Fe56, 0.0); + + jac.set(S32, Co55, 0.0); + + jac.set(S32, Co56, 0.0); + + jac.set(S32, Co57, 0.0); + + jac.set(S32, Ni56, 0.0); + + jac.set(S32, Ni57, 0.0); + + jac.set(S32, Ni58, 0.0); + + jac.set(S32, Cu59, 0.0); + + jac.set(S32, Zn60, 0.0); + + jac.set(S33, N, 0.0); + + scratch = -screened_rates(k_p_S33_to_Cl34_reaclib)*Y(S33)*state.rho - screened_rates(k_p_S33_to_He4_P30_derived)*Y(S33)*state.rho; + jac.set(S33, H1, scratch); + + scratch = screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(P30)*state.rho - screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(S33)*state.rho + screened_rates(k_He4_Si29_to_S33_reaclib)*Y(Si29)*state.rho; + jac.set(S33, He4, scratch); + + jac.set(S33, C12, 0.0); + + jac.set(S33, C13, 0.0); + + jac.set(S33, C14, 0.0); + + jac.set(S33, N13, 0.0); + + jac.set(S33, N14, 0.0); + + jac.set(S33, N15, 0.0); + + jac.set(S33, O16, 0.0); + + jac.set(S33, O17, 0.0); + + jac.set(S33, O18, 0.0); + + jac.set(S33, F18, 0.0); + + jac.set(S33, F19, 0.0); + + jac.set(S33, Ne20, 0.0); + + jac.set(S33, Ne21, 0.0); + + jac.set(S33, Ne22, 0.0); + + jac.set(S33, Na22, 0.0); + + jac.set(S33, Na23, 0.0); + + jac.set(S33, Mg24, 0.0); + + jac.set(S33, Mg25, 0.0); + + jac.set(S33, Al26, 0.0); + + jac.set(S33, Al27, 0.0); + + jac.set(S33, Si28, 0.0); + + scratch = screened_rates(k_He4_Si29_to_S33_reaclib)*Y(He4)*state.rho; + jac.set(S33, Si29, scratch); + + scratch = screened_rates(k_He4_P30_to_p_S33_reaclib)*Y(He4)*state.rho; + jac.set(S33, P30, scratch); + + jac.set(S33, P31, 0.0); + + jac.set(S33, S32, 0.0); + + scratch = -screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(He4)*state.rho - screened_rates(k_S33_to_He4_Si29_derived) - screened_rates(k_p_S33_to_Cl34_reaclib)*Y(H1)*state.rho - screened_rates(k_p_S33_to_He4_P30_derived)*Y(H1)*state.rho; + jac.set(S33, S33, scratch); + + scratch = screened_rates(k_Cl34_to_p_S33_derived); + jac.set(S33, Cl34, scratch); + + jac.set(S33, Cl35, 0.0); + + jac.set(S33, Ar36, 0.0); + + scratch = screened_rates(k_Ar37_to_He4_S33_derived); + jac.set(S33, Ar37, scratch); + + jac.set(S33, K38, 0.0); + + jac.set(S33, K39, 0.0); + + jac.set(S33, Ca40, 0.0); + + jac.set(S33, Ca41, 0.0); + + jac.set(S33, Sc42, 0.0); + + jac.set(S33, Sc43, 0.0); + + jac.set(S33, Ti44, 0.0); + + jac.set(S33, Ti45, 0.0); + + jac.set(S33, V46, 0.0); + + jac.set(S33, V47, 0.0); + + jac.set(S33, Cr48, 0.0); + + jac.set(S33, Cr49, 0.0); + + jac.set(S33, Mn50, 0.0); + + jac.set(S33, Mn51, 0.0); + + jac.set(S33, Mn52, 0.0); + + jac.set(S33, Fe52, 0.0); + + jac.set(S33, Fe53, 0.0); + + jac.set(S33, Fe54, 0.0); + + jac.set(S33, Fe55, 0.0); + + jac.set(S33, Fe56, 0.0); + + jac.set(S33, Co55, 0.0); + + jac.set(S33, Co56, 0.0); + + jac.set(S33, Co57, 0.0); + + jac.set(S33, Ni56, 0.0); + + jac.set(S33, Ni57, 0.0); + + jac.set(S33, Ni58, 0.0); + + jac.set(S33, Cu59, 0.0); + + jac.set(S33, Zn60, 0.0); + + jac.set(Cl34, N, 0.0); + + scratch = screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*state.rho + screened_rates(k_p_S33_to_Cl34_reaclib)*Y(S33)*state.rho; + jac.set(Cl34, H1, scratch); + + scratch = -screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(Cl34)*state.rho - screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*state.rho + screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(P30)*state.rho; + jac.set(Cl34, He4, scratch); + + jac.set(Cl34, C12, 0.0); + + jac.set(Cl34, C13, 0.0); + + jac.set(Cl34, C14, 0.0); + + jac.set(Cl34, N13, 0.0); + + jac.set(Cl34, N14, 0.0); + + jac.set(Cl34, N15, 0.0); + + jac.set(Cl34, O16, 0.0); + + jac.set(Cl34, O17, 0.0); + + jac.set(Cl34, O18, 0.0); + + jac.set(Cl34, F18, 0.0); + + jac.set(Cl34, F19, 0.0); + + jac.set(Cl34, Ne20, 0.0); + + jac.set(Cl34, Ne21, 0.0); + + jac.set(Cl34, Ne22, 0.0); + + jac.set(Cl34, Na22, 0.0); + + jac.set(Cl34, Na23, 0.0); + + jac.set(Cl34, Mg24, 0.0); + + jac.set(Cl34, Mg25, 0.0); + + jac.set(Cl34, Al26, 0.0); + + jac.set(Cl34, Al27, 0.0); + + jac.set(Cl34, Si28, 0.0); + + jac.set(Cl34, Si29, 0.0); + + scratch = screened_rates(k_He4_P30_to_Cl34_reaclib)*Y(He4)*state.rho; + jac.set(Cl34, P30, scratch); + + jac.set(Cl34, P31, 0.0); + + jac.set(Cl34, S32, 0.0); + + scratch = screened_rates(k_p_S33_to_Cl34_reaclib)*Y(H1)*state.rho; + jac.set(Cl34, S33, scratch); + + scratch = -screened_rates(k_Cl34_to_He4_P30_derived) - screened_rates(k_Cl34_to_p_S33_derived) - screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(He4)*state.rho; + jac.set(Cl34, Cl34, scratch); + + jac.set(Cl34, Cl35, 0.0); + + jac.set(Cl34, Ar36, 0.0); + + scratch = screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(H1)*state.rho; + jac.set(Cl34, Ar37, scratch); + + scratch = screened_rates(k_K38_to_He4_Cl34_derived); + jac.set(Cl34, K38, scratch); + + jac.set(Cl34, K39, 0.0); + + jac.set(Cl34, Ca40, 0.0); + + jac.set(Cl34, Ca41, 0.0); + + jac.set(Cl34, Sc42, 0.0); + + jac.set(Cl34, Sc43, 0.0); + + jac.set(Cl34, Ti44, 0.0); + + jac.set(Cl34, Ti45, 0.0); + + jac.set(Cl34, V46, 0.0); + + jac.set(Cl34, V47, 0.0); + + jac.set(Cl34, Cr48, 0.0); + + jac.set(Cl34, Cr49, 0.0); + + jac.set(Cl34, Mn50, 0.0); + + jac.set(Cl34, Mn51, 0.0); + + jac.set(Cl34, Mn52, 0.0); + + jac.set(Cl34, Fe52, 0.0); + + jac.set(Cl34, Fe53, 0.0); + + jac.set(Cl34, Fe54, 0.0); + + jac.set(Cl34, Fe55, 0.0); + + jac.set(Cl34, Fe56, 0.0); + + jac.set(Cl34, Co55, 0.0); + + jac.set(Cl34, Co56, 0.0); + + jac.set(Cl34, Co57, 0.0); + + jac.set(Cl34, Ni56, 0.0); + + jac.set(Cl34, Ni57, 0.0); + + jac.set(Cl34, Ni58, 0.0); + + jac.set(Cl34, Cu59, 0.0); + + jac.set(Cl34, Zn60, 0.0); + + jac.set(Cl35, N, 0.0); + + scratch = -screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(Cl35)*state.rho - screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(Cl35)*state.rho; + jac.set(Cl35, H1, scratch); + + scratch = -screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(Cl35)*state.rho + screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(P31)*state.rho + screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(S32)*state.rho; + jac.set(Cl35, He4, scratch); + + jac.set(Cl35, C12, 0.0); + + jac.set(Cl35, C13, 0.0); + + jac.set(Cl35, C14, 0.0); + + jac.set(Cl35, N13, 0.0); + + jac.set(Cl35, N14, 0.0); + + jac.set(Cl35, N15, 0.0); + + jac.set(Cl35, O16, 0.0); + + jac.set(Cl35, O17, 0.0); + + jac.set(Cl35, O18, 0.0); + + jac.set(Cl35, F18, 0.0); + + jac.set(Cl35, F19, 0.0); + + jac.set(Cl35, Ne20, 0.0); + + jac.set(Cl35, Ne21, 0.0); + + jac.set(Cl35, Ne22, 0.0); + + jac.set(Cl35, Na22, 0.0); + + jac.set(Cl35, Na23, 0.0); + + jac.set(Cl35, Mg24, 0.0); + + jac.set(Cl35, Mg25, 0.0); + + jac.set(Cl35, Al26, 0.0); + + jac.set(Cl35, Al27, 0.0); + + jac.set(Cl35, Si28, 0.0); + + jac.set(Cl35, Si29, 0.0); + + jac.set(Cl35, P30, 0.0); + + scratch = screened_rates(k_He4_P31_to_Cl35_reaclib)*Y(He4)*state.rho; + jac.set(Cl35, P31, scratch); + + scratch = screened_rates(k_He4_S32_to_p_Cl35_derived)*Y(He4)*state.rho; + jac.set(Cl35, S32, scratch); + + jac.set(Cl35, S33, 0.0); + + jac.set(Cl35, Cl34, 0.0); + + scratch = -screened_rates(k_Cl35_to_He4_P31_derived) - screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Cl35_to_He4_S32_reaclib)*Y(H1)*state.rho; + jac.set(Cl35, Cl35, scratch); + + scratch = screened_rates(k_Ar36_to_p_Cl35_derived); + jac.set(Cl35, Ar36, scratch); + + jac.set(Cl35, Ar37, 0.0); + + jac.set(Cl35, K38, 0.0); + + scratch = screened_rates(k_K39_to_He4_Cl35_derived); + jac.set(Cl35, K39, scratch); + + jac.set(Cl35, Ca40, 0.0); + + jac.set(Cl35, Ca41, 0.0); + + jac.set(Cl35, Sc42, 0.0); + + jac.set(Cl35, Sc43, 0.0); + + jac.set(Cl35, Ti44, 0.0); + + jac.set(Cl35, Ti45, 0.0); + + jac.set(Cl35, V46, 0.0); + + jac.set(Cl35, V47, 0.0); + + jac.set(Cl35, Cr48, 0.0); + + jac.set(Cl35, Cr49, 0.0); + + jac.set(Cl35, Mn50, 0.0); + + jac.set(Cl35, Mn51, 0.0); + + jac.set(Cl35, Mn52, 0.0); + + jac.set(Cl35, Fe52, 0.0); + + jac.set(Cl35, Fe53, 0.0); + + jac.set(Cl35, Fe54, 0.0); + + jac.set(Cl35, Fe55, 0.0); + + jac.set(Cl35, Fe56, 0.0); + + jac.set(Cl35, Co55, 0.0); + + jac.set(Cl35, Co56, 0.0); + + jac.set(Cl35, Co57, 0.0); + + jac.set(Cl35, Ni56, 0.0); + + jac.set(Cl35, Ni57, 0.0); + + jac.set(Cl35, Ni58, 0.0); + + jac.set(Cl35, Cu59, 0.0); + + jac.set(Cl35, Zn60, 0.0); + + jac.set(Ar36, N, 0.0); + + scratch = screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(Cl35)*state.rho + screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*state.rho; + jac.set(Ar36, H1, scratch); + + scratch = -screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(Ar36)*state.rho - screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*state.rho + screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(S32)*state.rho; + jac.set(Ar36, He4, scratch); + + jac.set(Ar36, C12, 0.0); + + jac.set(Ar36, C13, 0.0); + + jac.set(Ar36, C14, 0.0); + + jac.set(Ar36, N13, 0.0); + + jac.set(Ar36, N14, 0.0); + + jac.set(Ar36, N15, 0.0); + + jac.set(Ar36, O16, 0.0); + + jac.set(Ar36, O17, 0.0); + + jac.set(Ar36, O18, 0.0); + + jac.set(Ar36, F18, 0.0); + + jac.set(Ar36, F19, 0.0); + + jac.set(Ar36, Ne20, 0.0); + + jac.set(Ar36, Ne21, 0.0); + + jac.set(Ar36, Ne22, 0.0); + + jac.set(Ar36, Na22, 0.0); + + jac.set(Ar36, Na23, 0.0); + + jac.set(Ar36, Mg24, 0.0); + + jac.set(Ar36, Mg25, 0.0); + + jac.set(Ar36, Al26, 0.0); + + jac.set(Ar36, Al27, 0.0); + + jac.set(Ar36, Si28, 0.0); + + jac.set(Ar36, Si29, 0.0); + + jac.set(Ar36, P30, 0.0); + + jac.set(Ar36, P31, 0.0); + + scratch = screened_rates(k_He4_S32_to_Ar36_reaclib)*Y(He4)*state.rho; + jac.set(Ar36, S32, scratch); + + jac.set(Ar36, S33, 0.0); + + jac.set(Ar36, Cl34, 0.0); + + scratch = screened_rates(k_p_Cl35_to_Ar36_reaclib)*Y(H1)*state.rho; + jac.set(Ar36, Cl35, scratch); + + scratch = -screened_rates(k_Ar36_to_He4_S32_derived) - screened_rates(k_Ar36_to_p_Cl35_derived) - screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(He4)*state.rho; + jac.set(Ar36, Ar36, scratch); + + jac.set(Ar36, Ar37, 0.0); + + jac.set(Ar36, K38, 0.0); + + scratch = screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(H1)*state.rho; + jac.set(Ar36, K39, scratch); + + scratch = screened_rates(k_Ca40_to_He4_Ar36_derived); + jac.set(Ar36, Ca40, scratch); + + jac.set(Ar36, Ca41, 0.0); + + jac.set(Ar36, Sc42, 0.0); + + jac.set(Ar36, Sc43, 0.0); + + jac.set(Ar36, Ti44, 0.0); + + jac.set(Ar36, Ti45, 0.0); + + jac.set(Ar36, V46, 0.0); + + jac.set(Ar36, V47, 0.0); + + jac.set(Ar36, Cr48, 0.0); + + jac.set(Ar36, Cr49, 0.0); + + jac.set(Ar36, Mn50, 0.0); + + jac.set(Ar36, Mn51, 0.0); + + jac.set(Ar36, Mn52, 0.0); + + jac.set(Ar36, Fe52, 0.0); + + jac.set(Ar36, Fe53, 0.0); + + jac.set(Ar36, Fe54, 0.0); + + jac.set(Ar36, Fe55, 0.0); + + jac.set(Ar36, Fe56, 0.0); + + jac.set(Ar36, Co55, 0.0); + + jac.set(Ar36, Co56, 0.0); + + jac.set(Ar36, Co57, 0.0); + + jac.set(Ar36, Ni56, 0.0); + + jac.set(Ar36, Ni57, 0.0); + + jac.set(Ar36, Ni58, 0.0); + + jac.set(Ar36, Cu59, 0.0); + + jac.set(Ar36, Zn60, 0.0); + + jac.set(Ar37, N, 0.0); + + scratch = -screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(Ar37)*state.rho - screened_rates(k_p_Ar37_to_K38_reaclib)*Y(Ar37)*state.rho; + jac.set(Ar37, H1, scratch); + + scratch = -screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(Ar37)*state.rho + screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(Cl34)*state.rho + screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(S33)*state.rho; + jac.set(Ar37, He4, scratch); + + jac.set(Ar37, C12, 0.0); + + jac.set(Ar37, C13, 0.0); + + jac.set(Ar37, C14, 0.0); + + jac.set(Ar37, N13, 0.0); + + jac.set(Ar37, N14, 0.0); + + jac.set(Ar37, N15, 0.0); + + jac.set(Ar37, O16, 0.0); + + jac.set(Ar37, O17, 0.0); + + jac.set(Ar37, O18, 0.0); + + jac.set(Ar37, F18, 0.0); + + jac.set(Ar37, F19, 0.0); + + jac.set(Ar37, Ne20, 0.0); + + jac.set(Ar37, Ne21, 0.0); + + jac.set(Ar37, Ne22, 0.0); + + jac.set(Ar37, Na22, 0.0); + + jac.set(Ar37, Na23, 0.0); + + jac.set(Ar37, Mg24, 0.0); + + jac.set(Ar37, Mg25, 0.0); + + jac.set(Ar37, Al26, 0.0); + + jac.set(Ar37, Al27, 0.0); + + jac.set(Ar37, Si28, 0.0); + + jac.set(Ar37, Si29, 0.0); + + jac.set(Ar37, P30, 0.0); + + jac.set(Ar37, P31, 0.0); + + jac.set(Ar37, S32, 0.0); + + scratch = screened_rates(k_He4_S33_to_Ar37_reaclib)*Y(He4)*state.rho; + jac.set(Ar37, S33, scratch); + + scratch = screened_rates(k_He4_Cl34_to_p_Ar37_reaclib)*Y(He4)*state.rho; + jac.set(Ar37, Cl34, scratch); + + jac.set(Ar37, Cl35, 0.0); + + jac.set(Ar37, Ar36, 0.0); + + scratch = -screened_rates(k_Ar37_to_He4_S33_derived) - screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Ar37_to_He4_Cl34_derived)*Y(H1)*state.rho - screened_rates(k_p_Ar37_to_K38_reaclib)*Y(H1)*state.rho; + jac.set(Ar37, Ar37, scratch); + + scratch = screened_rates(k_K38_to_p_Ar37_derived); + jac.set(Ar37, K38, scratch); + + jac.set(Ar37, K39, 0.0); + + jac.set(Ar37, Ca40, 0.0); + + scratch = screened_rates(k_Ca41_to_He4_Ar37_derived); + jac.set(Ar37, Ca41, scratch); + + jac.set(Ar37, Sc42, 0.0); + + jac.set(Ar37, Sc43, 0.0); + + jac.set(Ar37, Ti44, 0.0); + + jac.set(Ar37, Ti45, 0.0); + + jac.set(Ar37, V46, 0.0); + + jac.set(Ar37, V47, 0.0); + + jac.set(Ar37, Cr48, 0.0); + + jac.set(Ar37, Cr49, 0.0); + + jac.set(Ar37, Mn50, 0.0); + + jac.set(Ar37, Mn51, 0.0); + + jac.set(Ar37, Mn52, 0.0); + + jac.set(Ar37, Fe52, 0.0); + + jac.set(Ar37, Fe53, 0.0); + + jac.set(Ar37, Fe54, 0.0); + + jac.set(Ar37, Fe55, 0.0); + + jac.set(Ar37, Fe56, 0.0); + + jac.set(Ar37, Co55, 0.0); + + jac.set(Ar37, Co56, 0.0); + + jac.set(Ar37, Co57, 0.0); + + jac.set(Ar37, Ni56, 0.0); + + jac.set(Ar37, Ni57, 0.0); + + jac.set(Ar37, Ni58, 0.0); + + jac.set(Ar37, Cu59, 0.0); + + jac.set(Ar37, Zn60, 0.0); + + jac.set(K38, N, 0.0); + + scratch = screened_rates(k_p_Ar37_to_K38_reaclib)*Y(Ar37)*state.rho + screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*state.rho; + jac.set(K38, H1, scratch); + + scratch = screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(Cl34)*state.rho - screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(K38)*state.rho - screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(K38)*state.rho; + jac.set(K38, He4, scratch); + + jac.set(K38, C12, 0.0); + + jac.set(K38, C13, 0.0); + + jac.set(K38, C14, 0.0); + + jac.set(K38, N13, 0.0); + + jac.set(K38, N14, 0.0); + + jac.set(K38, N15, 0.0); + + jac.set(K38, O16, 0.0); + + jac.set(K38, O17, 0.0); + + jac.set(K38, O18, 0.0); + + jac.set(K38, F18, 0.0); + + jac.set(K38, F19, 0.0); + + jac.set(K38, Ne20, 0.0); + + jac.set(K38, Ne21, 0.0); + + jac.set(K38, Ne22, 0.0); + + jac.set(K38, Na22, 0.0); + + jac.set(K38, Na23, 0.0); + + jac.set(K38, Mg24, 0.0); + + jac.set(K38, Mg25, 0.0); + + jac.set(K38, Al26, 0.0); + + jac.set(K38, Al27, 0.0); + + jac.set(K38, Si28, 0.0); + + jac.set(K38, Si29, 0.0); + + jac.set(K38, P30, 0.0); + + jac.set(K38, P31, 0.0); + + jac.set(K38, S32, 0.0); + + jac.set(K38, S33, 0.0); + + scratch = screened_rates(k_He4_Cl34_to_K38_reaclib)*Y(He4)*state.rho; + jac.set(K38, Cl34, scratch); + + jac.set(K38, Cl35, 0.0); + + jac.set(K38, Ar36, 0.0); + + scratch = screened_rates(k_p_Ar37_to_K38_reaclib)*Y(H1)*state.rho; + jac.set(K38, Ar37, scratch); + + scratch = -screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*state.rho - screened_rates(k_K38_to_He4_Cl34_derived) - screened_rates(k_K38_to_p_Ar37_derived); + jac.set(K38, K38, scratch); + + jac.set(K38, K39, 0.0); + + jac.set(K38, Ca40, 0.0); + + scratch = screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(H1)*state.rho; + jac.set(K38, Ca41, scratch); + + scratch = screened_rates(k_Sc42_to_He4_K38_derived); + jac.set(K38, Sc42, scratch); + + jac.set(K38, Sc43, 0.0); + + jac.set(K38, Ti44, 0.0); + + jac.set(K38, Ti45, 0.0); + + jac.set(K38, V46, 0.0); + + jac.set(K38, V47, 0.0); + + jac.set(K38, Cr48, 0.0); + + jac.set(K38, Cr49, 0.0); + + jac.set(K38, Mn50, 0.0); + + jac.set(K38, Mn51, 0.0); + + jac.set(K38, Mn52, 0.0); + + jac.set(K38, Fe52, 0.0); + + jac.set(K38, Fe53, 0.0); + + jac.set(K38, Fe54, 0.0); + + jac.set(K38, Fe55, 0.0); + + jac.set(K38, Fe56, 0.0); + + jac.set(K38, Co55, 0.0); + + jac.set(K38, Co56, 0.0); + + jac.set(K38, Co57, 0.0); + + jac.set(K38, Ni56, 0.0); + + jac.set(K38, Ni57, 0.0); + + jac.set(K38, Ni58, 0.0); + + jac.set(K38, Cu59, 0.0); + + jac.set(K38, Zn60, 0.0); + + jac.set(K39, N, 0.0); + + scratch = -screened_rates(k_p_K39_to_Ca40_reaclib)*Y(K39)*state.rho - screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(K39)*state.rho; + jac.set(K39, H1, scratch); + + scratch = screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(Ar36)*state.rho + screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(Cl35)*state.rho - screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(K39)*state.rho; + jac.set(K39, He4, scratch); + + jac.set(K39, C12, 0.0); + + jac.set(K39, C13, 0.0); + + jac.set(K39, C14, 0.0); + + jac.set(K39, N13, 0.0); + + jac.set(K39, N14, 0.0); + + jac.set(K39, N15, 0.0); + + jac.set(K39, O16, 0.0); + + jac.set(K39, O17, 0.0); + + jac.set(K39, O18, 0.0); + + jac.set(K39, F18, 0.0); + + jac.set(K39, F19, 0.0); + + jac.set(K39, Ne20, 0.0); + + jac.set(K39, Ne21, 0.0); + + jac.set(K39, Ne22, 0.0); + + jac.set(K39, Na22, 0.0); + + jac.set(K39, Na23, 0.0); + + jac.set(K39, Mg24, 0.0); + + jac.set(K39, Mg25, 0.0); + + jac.set(K39, Al26, 0.0); + + jac.set(K39, Al27, 0.0); + + jac.set(K39, Si28, 0.0); + + jac.set(K39, Si29, 0.0); + + jac.set(K39, P30, 0.0); + + jac.set(K39, P31, 0.0); + + jac.set(K39, S32, 0.0); + + jac.set(K39, S33, 0.0); + + jac.set(K39, Cl34, 0.0); + + scratch = screened_rates(k_He4_Cl35_to_K39_reaclib)*Y(He4)*state.rho; + jac.set(K39, Cl35, scratch); + + scratch = screened_rates(k_He4_Ar36_to_p_K39_derived)*Y(He4)*state.rho; + jac.set(K39, Ar36, scratch); + + jac.set(K39, Ar37, 0.0); + + jac.set(K39, K38, 0.0); + + scratch = -screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(He4)*state.rho - screened_rates(k_K39_to_He4_Cl35_derived) - screened_rates(k_p_K39_to_Ca40_reaclib)*Y(H1)*state.rho - screened_rates(k_p_K39_to_He4_Ar36_reaclib)*Y(H1)*state.rho; + jac.set(K39, K39, scratch); + + scratch = screened_rates(k_Ca40_to_p_K39_derived); + jac.set(K39, Ca40, scratch); + + jac.set(K39, Ca41, 0.0); + + jac.set(K39, Sc42, 0.0); + + scratch = screened_rates(k_Sc43_to_He4_K39_derived); + jac.set(K39, Sc43, scratch); + + jac.set(K39, Ti44, 0.0); + + jac.set(K39, Ti45, 0.0); + + jac.set(K39, V46, 0.0); + + jac.set(K39, V47, 0.0); + + jac.set(K39, Cr48, 0.0); + + jac.set(K39, Cr49, 0.0); + + jac.set(K39, Mn50, 0.0); + + jac.set(K39, Mn51, 0.0); + + jac.set(K39, Mn52, 0.0); + + jac.set(K39, Fe52, 0.0); + + jac.set(K39, Fe53, 0.0); + + jac.set(K39, Fe54, 0.0); + + jac.set(K39, Fe55, 0.0); + + jac.set(K39, Fe56, 0.0); + + jac.set(K39, Co55, 0.0); + + jac.set(K39, Co56, 0.0); + + jac.set(K39, Co57, 0.0); + + jac.set(K39, Ni56, 0.0); + + jac.set(K39, Ni57, 0.0); + + jac.set(K39, Ni58, 0.0); + + jac.set(K39, Cu59, 0.0); + + jac.set(K39, Zn60, 0.0); + + jac.set(Ca40, N, 0.0); + + scratch = screened_rates(k_p_K39_to_Ca40_reaclib)*Y(K39)*state.rho + screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*state.rho; + jac.set(Ca40, H1, scratch); + + scratch = screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(Ar36)*state.rho - screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(Ca40)*state.rho - screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*state.rho; + jac.set(Ca40, He4, scratch); + + jac.set(Ca40, C12, 0.0); + + jac.set(Ca40, C13, 0.0); + + jac.set(Ca40, C14, 0.0); + + jac.set(Ca40, N13, 0.0); + + jac.set(Ca40, N14, 0.0); + + jac.set(Ca40, N15, 0.0); + + jac.set(Ca40, O16, 0.0); + + jac.set(Ca40, O17, 0.0); + + jac.set(Ca40, O18, 0.0); + + jac.set(Ca40, F18, 0.0); + + jac.set(Ca40, F19, 0.0); + + jac.set(Ca40, Ne20, 0.0); + + jac.set(Ca40, Ne21, 0.0); + + jac.set(Ca40, Ne22, 0.0); + + jac.set(Ca40, Na22, 0.0); + + jac.set(Ca40, Na23, 0.0); + + jac.set(Ca40, Mg24, 0.0); + + jac.set(Ca40, Mg25, 0.0); + + jac.set(Ca40, Al26, 0.0); + + jac.set(Ca40, Al27, 0.0); + + jac.set(Ca40, Si28, 0.0); + + jac.set(Ca40, Si29, 0.0); + + jac.set(Ca40, P30, 0.0); + + jac.set(Ca40, P31, 0.0); + + jac.set(Ca40, S32, 0.0); + + jac.set(Ca40, S33, 0.0); + + jac.set(Ca40, Cl34, 0.0); + + jac.set(Ca40, Cl35, 0.0); + + scratch = screened_rates(k_He4_Ar36_to_Ca40_reaclib)*Y(He4)*state.rho; + jac.set(Ca40, Ar36, scratch); + + jac.set(Ca40, Ar37, 0.0); + + jac.set(Ca40, K38, 0.0); + + scratch = screened_rates(k_p_K39_to_Ca40_reaclib)*Y(H1)*state.rho; + jac.set(Ca40, K39, scratch); + + scratch = -screened_rates(k_Ca40_to_He4_Ar36_derived) - screened_rates(k_Ca40_to_p_K39_derived) - screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(He4)*state.rho; + jac.set(Ca40, Ca40, scratch); + + jac.set(Ca40, Ca41, 0.0); + + jac.set(Ca40, Sc42, 0.0); + + scratch = screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(H1)*state.rho; + jac.set(Ca40, Sc43, scratch); + + scratch = screened_rates(k_Ti44_to_He4_Ca40_derived); + jac.set(Ca40, Ti44, scratch); + + jac.set(Ca40, Ti45, 0.0); + + jac.set(Ca40, V46, 0.0); + + jac.set(Ca40, V47, 0.0); + + jac.set(Ca40, Cr48, 0.0); + + jac.set(Ca40, Cr49, 0.0); + + jac.set(Ca40, Mn50, 0.0); + + jac.set(Ca40, Mn51, 0.0); + + jac.set(Ca40, Mn52, 0.0); + + jac.set(Ca40, Fe52, 0.0); + + jac.set(Ca40, Fe53, 0.0); + + jac.set(Ca40, Fe54, 0.0); + + jac.set(Ca40, Fe55, 0.0); + + jac.set(Ca40, Fe56, 0.0); + + jac.set(Ca40, Co55, 0.0); + + jac.set(Ca40, Co56, 0.0); + + jac.set(Ca40, Co57, 0.0); + + jac.set(Ca40, Ni56, 0.0); + + jac.set(Ca40, Ni57, 0.0); + + jac.set(Ca40, Ni58, 0.0); + + jac.set(Ca40, Cu59, 0.0); + + jac.set(Ca40, Zn60, 0.0); + + jac.set(Ca41, N, 0.0); + + scratch = -screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(Ca41)*state.rho - screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(Ca41)*state.rho; + jac.set(Ca41, H1, scratch); + + scratch = screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(Ar37)*state.rho - screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(Ca41)*state.rho + screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(K38)*state.rho; + jac.set(Ca41, He4, scratch); + + jac.set(Ca41, C12, 0.0); + + jac.set(Ca41, C13, 0.0); + + jac.set(Ca41, C14, 0.0); + + jac.set(Ca41, N13, 0.0); + + jac.set(Ca41, N14, 0.0); + + jac.set(Ca41, N15, 0.0); + + jac.set(Ca41, O16, 0.0); + + jac.set(Ca41, O17, 0.0); + + jac.set(Ca41, O18, 0.0); + + jac.set(Ca41, F18, 0.0); + + jac.set(Ca41, F19, 0.0); + + jac.set(Ca41, Ne20, 0.0); + + jac.set(Ca41, Ne21, 0.0); + + jac.set(Ca41, Ne22, 0.0); + + jac.set(Ca41, Na22, 0.0); + + jac.set(Ca41, Na23, 0.0); + + jac.set(Ca41, Mg24, 0.0); + + jac.set(Ca41, Mg25, 0.0); + + jac.set(Ca41, Al26, 0.0); + + jac.set(Ca41, Al27, 0.0); + + jac.set(Ca41, Si28, 0.0); + + jac.set(Ca41, Si29, 0.0); + + jac.set(Ca41, P30, 0.0); + + jac.set(Ca41, P31, 0.0); + + jac.set(Ca41, S32, 0.0); + + jac.set(Ca41, S33, 0.0); + + jac.set(Ca41, Cl34, 0.0); + + jac.set(Ca41, Cl35, 0.0); + + jac.set(Ca41, Ar36, 0.0); + + scratch = screened_rates(k_He4_Ar37_to_Ca41_reaclib)*Y(He4)*state.rho; + jac.set(Ca41, Ar37, scratch); + + scratch = screened_rates(k_He4_K38_to_p_Ca41_reaclib)*Y(He4)*state.rho; + jac.set(Ca41, K38, scratch); + + jac.set(Ca41, K39, 0.0); + + jac.set(Ca41, Ca40, 0.0); + + scratch = -screened_rates(k_Ca41_to_He4_Ar37_derived) - screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Ca41_to_He4_K38_derived)*Y(H1)*state.rho - screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(H1)*state.rho; + jac.set(Ca41, Ca41, scratch); + + scratch = screened_rates(k_Sc42_to_p_Ca41_derived); + jac.set(Ca41, Sc42, scratch); + + jac.set(Ca41, Sc43, 0.0); + + jac.set(Ca41, Ti44, 0.0); + + scratch = screened_rates(k_Ti45_to_He4_Ca41_derived); + jac.set(Ca41, Ti45, scratch); + + jac.set(Ca41, V46, 0.0); + + jac.set(Ca41, V47, 0.0); + + jac.set(Ca41, Cr48, 0.0); + + jac.set(Ca41, Cr49, 0.0); + + jac.set(Ca41, Mn50, 0.0); + + jac.set(Ca41, Mn51, 0.0); + + jac.set(Ca41, Mn52, 0.0); + + jac.set(Ca41, Fe52, 0.0); + + jac.set(Ca41, Fe53, 0.0); + + jac.set(Ca41, Fe54, 0.0); + + jac.set(Ca41, Fe55, 0.0); + + jac.set(Ca41, Fe56, 0.0); + + jac.set(Ca41, Co55, 0.0); + + jac.set(Ca41, Co56, 0.0); + + jac.set(Ca41, Co57, 0.0); + + jac.set(Ca41, Ni56, 0.0); + + jac.set(Ca41, Ni57, 0.0); + + jac.set(Ca41, Ni58, 0.0); + + jac.set(Ca41, Cu59, 0.0); + + jac.set(Ca41, Zn60, 0.0); + + jac.set(Sc42, N, 0.0); + + scratch = screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(Ca41)*state.rho + screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*state.rho; + jac.set(Sc42, H1, scratch); + + scratch = screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(K38)*state.rho - screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(Sc42)*state.rho - screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(Sc42)*state.rho; + jac.set(Sc42, He4, scratch); + + jac.set(Sc42, C12, 0.0); + + jac.set(Sc42, C13, 0.0); + + jac.set(Sc42, C14, 0.0); + + jac.set(Sc42, N13, 0.0); + + jac.set(Sc42, N14, 0.0); + + jac.set(Sc42, N15, 0.0); + + jac.set(Sc42, O16, 0.0); + + jac.set(Sc42, O17, 0.0); + + jac.set(Sc42, O18, 0.0); + + jac.set(Sc42, F18, 0.0); + + jac.set(Sc42, F19, 0.0); + + jac.set(Sc42, Ne20, 0.0); + + jac.set(Sc42, Ne21, 0.0); + + jac.set(Sc42, Ne22, 0.0); + + jac.set(Sc42, Na22, 0.0); + + jac.set(Sc42, Na23, 0.0); + + jac.set(Sc42, Mg24, 0.0); + + jac.set(Sc42, Mg25, 0.0); + + jac.set(Sc42, Al26, 0.0); + + jac.set(Sc42, Al27, 0.0); + + jac.set(Sc42, Si28, 0.0); + + jac.set(Sc42, Si29, 0.0); + + jac.set(Sc42, P30, 0.0); + + jac.set(Sc42, P31, 0.0); + + jac.set(Sc42, S32, 0.0); + + jac.set(Sc42, S33, 0.0); + + jac.set(Sc42, Cl34, 0.0); + + jac.set(Sc42, Cl35, 0.0); + + jac.set(Sc42, Ar36, 0.0); + + jac.set(Sc42, Ar37, 0.0); + + scratch = screened_rates(k_He4_K38_to_Sc42_reaclib)*Y(He4)*state.rho; + jac.set(Sc42, K38, scratch); + + jac.set(Sc42, K39, 0.0); + + jac.set(Sc42, Ca40, 0.0); + + scratch = screened_rates(k_p_Ca41_to_Sc42_reaclib)*Y(H1)*state.rho; + jac.set(Sc42, Ca41, scratch); + + scratch = -screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*state.rho - screened_rates(k_Sc42_to_He4_K38_derived) - screened_rates(k_Sc42_to_p_Ca41_derived); + jac.set(Sc42, Sc42, scratch); + + jac.set(Sc42, Sc43, 0.0); + + jac.set(Sc42, Ti44, 0.0); + + scratch = screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(H1)*state.rho; + jac.set(Sc42, Ti45, scratch); + + scratch = screened_rates(k_V46_to_He4_Sc42_derived); + jac.set(Sc42, V46, scratch); + + jac.set(Sc42, V47, 0.0); + + jac.set(Sc42, Cr48, 0.0); + + jac.set(Sc42, Cr49, 0.0); + + jac.set(Sc42, Mn50, 0.0); + + jac.set(Sc42, Mn51, 0.0); + + jac.set(Sc42, Mn52, 0.0); + + jac.set(Sc42, Fe52, 0.0); + + jac.set(Sc42, Fe53, 0.0); + + jac.set(Sc42, Fe54, 0.0); + + jac.set(Sc42, Fe55, 0.0); + + jac.set(Sc42, Fe56, 0.0); + + jac.set(Sc42, Co55, 0.0); + + jac.set(Sc42, Co56, 0.0); + + jac.set(Sc42, Co57, 0.0); + + jac.set(Sc42, Ni56, 0.0); + + jac.set(Sc42, Ni57, 0.0); + + jac.set(Sc42, Ni58, 0.0); + + jac.set(Sc42, Cu59, 0.0); + + jac.set(Sc42, Zn60, 0.0); + + jac.set(Sc43, N, 0.0); + + scratch = -screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(Sc43)*state.rho - screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(Sc43)*state.rho; + jac.set(Sc43, H1, scratch); + + scratch = screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(Ca40)*state.rho + screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(K39)*state.rho - screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(Sc43)*state.rho; + jac.set(Sc43, He4, scratch); + + jac.set(Sc43, C12, 0.0); + + jac.set(Sc43, C13, 0.0); + + jac.set(Sc43, C14, 0.0); + + jac.set(Sc43, N13, 0.0); + + jac.set(Sc43, N14, 0.0); + + jac.set(Sc43, N15, 0.0); + + jac.set(Sc43, O16, 0.0); + + jac.set(Sc43, O17, 0.0); + + jac.set(Sc43, O18, 0.0); + + jac.set(Sc43, F18, 0.0); + + jac.set(Sc43, F19, 0.0); + + jac.set(Sc43, Ne20, 0.0); + + jac.set(Sc43, Ne21, 0.0); + + jac.set(Sc43, Ne22, 0.0); + + jac.set(Sc43, Na22, 0.0); + + jac.set(Sc43, Na23, 0.0); + + jac.set(Sc43, Mg24, 0.0); + + jac.set(Sc43, Mg25, 0.0); + + jac.set(Sc43, Al26, 0.0); + + jac.set(Sc43, Al27, 0.0); + + jac.set(Sc43, Si28, 0.0); + + jac.set(Sc43, Si29, 0.0); + + jac.set(Sc43, P30, 0.0); + + jac.set(Sc43, P31, 0.0); + + jac.set(Sc43, S32, 0.0); + + jac.set(Sc43, S33, 0.0); + + jac.set(Sc43, Cl34, 0.0); + + jac.set(Sc43, Cl35, 0.0); + + jac.set(Sc43, Ar36, 0.0); + + jac.set(Sc43, Ar37, 0.0); + + jac.set(Sc43, K38, 0.0); + + scratch = screened_rates(k_He4_K39_to_Sc43_reaclib)*Y(He4)*state.rho; + jac.set(Sc43, K39, scratch); + + scratch = screened_rates(k_He4_Ca40_to_p_Sc43_derived)*Y(He4)*state.rho; + jac.set(Sc43, Ca40, scratch); + + jac.set(Sc43, Ca41, 0.0); + + jac.set(Sc43, Sc42, 0.0); + + scratch = -screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(He4)*state.rho - screened_rates(k_Sc43_to_He4_K39_derived) - screened_rates(k_p_Sc43_to_He4_Ca40_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(H1)*state.rho; + jac.set(Sc43, Sc43, scratch); + + scratch = screened_rates(k_Ti44_to_p_Sc43_derived); + jac.set(Sc43, Ti44, scratch); + + jac.set(Sc43, Ti45, 0.0); + + jac.set(Sc43, V46, 0.0); + + scratch = screened_rates(k_V47_to_He4_Sc43_derived); + jac.set(Sc43, V47, scratch); + + jac.set(Sc43, Cr48, 0.0); + + jac.set(Sc43, Cr49, 0.0); + + jac.set(Sc43, Mn50, 0.0); + + jac.set(Sc43, Mn51, 0.0); + + jac.set(Sc43, Mn52, 0.0); + + jac.set(Sc43, Fe52, 0.0); + + jac.set(Sc43, Fe53, 0.0); + + jac.set(Sc43, Fe54, 0.0); + + jac.set(Sc43, Fe55, 0.0); + + jac.set(Sc43, Fe56, 0.0); + + jac.set(Sc43, Co55, 0.0); + + jac.set(Sc43, Co56, 0.0); + + jac.set(Sc43, Co57, 0.0); + + jac.set(Sc43, Ni56, 0.0); + + jac.set(Sc43, Ni57, 0.0); + + jac.set(Sc43, Ni58, 0.0); + + jac.set(Sc43, Cu59, 0.0); + + jac.set(Sc43, Zn60, 0.0); + + jac.set(Ti44, N, 0.0); + + scratch = screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(Sc43)*state.rho + screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*state.rho; + jac.set(Ti44, H1, scratch); + + scratch = screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(Ca40)*state.rho - screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(Ti44)*state.rho - screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(Ti44)*state.rho; + jac.set(Ti44, He4, scratch); + + jac.set(Ti44, C12, 0.0); + + jac.set(Ti44, C13, 0.0); + + jac.set(Ti44, C14, 0.0); + + jac.set(Ti44, N13, 0.0); + + jac.set(Ti44, N14, 0.0); + + jac.set(Ti44, N15, 0.0); + + jac.set(Ti44, O16, 0.0); + + jac.set(Ti44, O17, 0.0); + + jac.set(Ti44, O18, 0.0); + + jac.set(Ti44, F18, 0.0); + + jac.set(Ti44, F19, 0.0); + + jac.set(Ti44, Ne20, 0.0); + + jac.set(Ti44, Ne21, 0.0); + + jac.set(Ti44, Ne22, 0.0); + + jac.set(Ti44, Na22, 0.0); + + jac.set(Ti44, Na23, 0.0); + + jac.set(Ti44, Mg24, 0.0); + + jac.set(Ti44, Mg25, 0.0); + + jac.set(Ti44, Al26, 0.0); + + jac.set(Ti44, Al27, 0.0); + + jac.set(Ti44, Si28, 0.0); + + jac.set(Ti44, Si29, 0.0); + + jac.set(Ti44, P30, 0.0); + + jac.set(Ti44, P31, 0.0); + + jac.set(Ti44, S32, 0.0); + + jac.set(Ti44, S33, 0.0); + + jac.set(Ti44, Cl34, 0.0); + + jac.set(Ti44, Cl35, 0.0); + + jac.set(Ti44, Ar36, 0.0); + + jac.set(Ti44, Ar37, 0.0); + + jac.set(Ti44, K38, 0.0); + + jac.set(Ti44, K39, 0.0); + + scratch = screened_rates(k_He4_Ca40_to_Ti44_reaclib)*Y(He4)*state.rho; + jac.set(Ti44, Ca40, scratch); + + jac.set(Ti44, Ca41, 0.0); + + jac.set(Ti44, Sc42, 0.0); + + scratch = screened_rates(k_p_Sc43_to_Ti44_reaclib)*Y(H1)*state.rho; + jac.set(Ti44, Sc43, scratch); + + scratch = -screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*state.rho - screened_rates(k_Ti44_to_He4_Ca40_derived) - screened_rates(k_Ti44_to_p_Sc43_derived); + jac.set(Ti44, Ti44, scratch); + + jac.set(Ti44, Ti45, 0.0); + + jac.set(Ti44, V46, 0.0); + + scratch = screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(H1)*state.rho; + jac.set(Ti44, V47, scratch); + + scratch = screened_rates(k_Cr48_to_He4_Ti44_derived); + jac.set(Ti44, Cr48, scratch); + + jac.set(Ti44, Cr49, 0.0); + + jac.set(Ti44, Mn50, 0.0); + + jac.set(Ti44, Mn51, 0.0); + + jac.set(Ti44, Mn52, 0.0); + + jac.set(Ti44, Fe52, 0.0); + + jac.set(Ti44, Fe53, 0.0); + + jac.set(Ti44, Fe54, 0.0); + + jac.set(Ti44, Fe55, 0.0); + + jac.set(Ti44, Fe56, 0.0); + + jac.set(Ti44, Co55, 0.0); + + jac.set(Ti44, Co56, 0.0); + + jac.set(Ti44, Co57, 0.0); + + jac.set(Ti44, Ni56, 0.0); + + jac.set(Ti44, Ni57, 0.0); + + jac.set(Ti44, Ni58, 0.0); + + jac.set(Ti44, Cu59, 0.0); + + jac.set(Ti44, Zn60, 0.0); + + jac.set(Ti45, N, 0.0); + + scratch = -screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(Ti45)*state.rho - screened_rates(k_p_Ti45_to_V46_reaclib)*Y(Ti45)*state.rho; + jac.set(Ti45, H1, scratch); + + scratch = screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(Ca41)*state.rho + screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(Sc42)*state.rho - screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(Ti45)*state.rho; + jac.set(Ti45, He4, scratch); + + jac.set(Ti45, C12, 0.0); + + jac.set(Ti45, C13, 0.0); + + jac.set(Ti45, C14, 0.0); + + jac.set(Ti45, N13, 0.0); + + jac.set(Ti45, N14, 0.0); + + jac.set(Ti45, N15, 0.0); + + jac.set(Ti45, O16, 0.0); + + jac.set(Ti45, O17, 0.0); + + jac.set(Ti45, O18, 0.0); + + jac.set(Ti45, F18, 0.0); + + jac.set(Ti45, F19, 0.0); + + jac.set(Ti45, Ne20, 0.0); + + jac.set(Ti45, Ne21, 0.0); + + jac.set(Ti45, Ne22, 0.0); + + jac.set(Ti45, Na22, 0.0); + + jac.set(Ti45, Na23, 0.0); + + jac.set(Ti45, Mg24, 0.0); + + jac.set(Ti45, Mg25, 0.0); + + jac.set(Ti45, Al26, 0.0); + + jac.set(Ti45, Al27, 0.0); + + jac.set(Ti45, Si28, 0.0); + + jac.set(Ti45, Si29, 0.0); + + jac.set(Ti45, P30, 0.0); + + jac.set(Ti45, P31, 0.0); + + jac.set(Ti45, S32, 0.0); + + jac.set(Ti45, S33, 0.0); + + jac.set(Ti45, Cl34, 0.0); + + jac.set(Ti45, Cl35, 0.0); + + jac.set(Ti45, Ar36, 0.0); + + jac.set(Ti45, Ar37, 0.0); + + jac.set(Ti45, K38, 0.0); + + jac.set(Ti45, K39, 0.0); + + jac.set(Ti45, Ca40, 0.0); + + scratch = screened_rates(k_He4_Ca41_to_Ti45_reaclib)*Y(He4)*state.rho; + jac.set(Ti45, Ca41, scratch); + + scratch = screened_rates(k_He4_Sc42_to_p_Ti45_reaclib)*Y(He4)*state.rho; + jac.set(Ti45, Sc42, scratch); + + jac.set(Ti45, Sc43, 0.0); + + jac.set(Ti45, Ti44, 0.0); + + scratch = -screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(He4)*state.rho - screened_rates(k_Ti45_to_He4_Ca41_derived) - screened_rates(k_p_Ti45_to_He4_Sc42_derived)*Y(H1)*state.rho - screened_rates(k_p_Ti45_to_V46_reaclib)*Y(H1)*state.rho; + jac.set(Ti45, Ti45, scratch); + + scratch = screened_rates(k_V46_to_p_Ti45_derived); + jac.set(Ti45, V46, scratch); + + jac.set(Ti45, V47, 0.0); + + jac.set(Ti45, Cr48, 0.0); + + scratch = screened_rates(k_Cr49_to_He4_Ti45_derived); + jac.set(Ti45, Cr49, scratch); + + jac.set(Ti45, Mn50, 0.0); + + jac.set(Ti45, Mn51, 0.0); + + jac.set(Ti45, Mn52, 0.0); + + jac.set(Ti45, Fe52, 0.0); + + jac.set(Ti45, Fe53, 0.0); + + jac.set(Ti45, Fe54, 0.0); + + jac.set(Ti45, Fe55, 0.0); + + jac.set(Ti45, Fe56, 0.0); + + jac.set(Ti45, Co55, 0.0); + + jac.set(Ti45, Co56, 0.0); + + jac.set(Ti45, Co57, 0.0); + + jac.set(Ti45, Ni56, 0.0); + + jac.set(Ti45, Ni57, 0.0); + + jac.set(Ti45, Ni58, 0.0); + + jac.set(Ti45, Cu59, 0.0); + + jac.set(Ti45, Zn60, 0.0); + + jac.set(V46, N, 0.0); + + scratch = screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*state.rho + screened_rates(k_p_Ti45_to_V46_reaclib)*Y(Ti45)*state.rho; + jac.set(V46, H1, scratch); + + scratch = screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(Sc42)*state.rho - screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(V46)*state.rho - screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(V46)*state.rho; + jac.set(V46, He4, scratch); + + jac.set(V46, C12, 0.0); + + jac.set(V46, C13, 0.0); + + jac.set(V46, C14, 0.0); + + jac.set(V46, N13, 0.0); + + jac.set(V46, N14, 0.0); + + jac.set(V46, N15, 0.0); + + jac.set(V46, O16, 0.0); + + jac.set(V46, O17, 0.0); + + jac.set(V46, O18, 0.0); + + jac.set(V46, F18, 0.0); + + jac.set(V46, F19, 0.0); + + jac.set(V46, Ne20, 0.0); + + jac.set(V46, Ne21, 0.0); + + jac.set(V46, Ne22, 0.0); + + jac.set(V46, Na22, 0.0); + + jac.set(V46, Na23, 0.0); + + jac.set(V46, Mg24, 0.0); + + jac.set(V46, Mg25, 0.0); + + jac.set(V46, Al26, 0.0); + + jac.set(V46, Al27, 0.0); + + jac.set(V46, Si28, 0.0); + + jac.set(V46, Si29, 0.0); + + jac.set(V46, P30, 0.0); + + jac.set(V46, P31, 0.0); + + jac.set(V46, S32, 0.0); + + jac.set(V46, S33, 0.0); + + jac.set(V46, Cl34, 0.0); + + jac.set(V46, Cl35, 0.0); + + jac.set(V46, Ar36, 0.0); + + jac.set(V46, Ar37, 0.0); + + jac.set(V46, K38, 0.0); + + jac.set(V46, K39, 0.0); + + jac.set(V46, Ca40, 0.0); + + jac.set(V46, Ca41, 0.0); + + scratch = screened_rates(k_He4_Sc42_to_V46_reaclib)*Y(He4)*state.rho; + jac.set(V46, Sc42, scratch); + + jac.set(V46, Sc43, 0.0); + + jac.set(V46, Ti44, 0.0); + + scratch = screened_rates(k_p_Ti45_to_V46_reaclib)*Y(H1)*state.rho; + jac.set(V46, Ti45, scratch); + + scratch = -screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*state.rho - screened_rates(k_V46_to_He4_Sc42_derived) - screened_rates(k_V46_to_p_Ti45_derived); + jac.set(V46, V46, scratch); + + jac.set(V46, V47, 0.0); + + jac.set(V46, Cr48, 0.0); + + scratch = screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(H1)*state.rho; + jac.set(V46, Cr49, scratch); + + scratch = screened_rates(k_Mn50_to_He4_V46_derived); + jac.set(V46, Mn50, scratch); + + jac.set(V46, Mn51, 0.0); + + jac.set(V46, Mn52, 0.0); + + jac.set(V46, Fe52, 0.0); + + jac.set(V46, Fe53, 0.0); + + jac.set(V46, Fe54, 0.0); + + jac.set(V46, Fe55, 0.0); + + jac.set(V46, Fe56, 0.0); + + jac.set(V46, Co55, 0.0); + + jac.set(V46, Co56, 0.0); + + jac.set(V46, Co57, 0.0); + + jac.set(V46, Ni56, 0.0); + + jac.set(V46, Ni57, 0.0); + + jac.set(V46, Ni58, 0.0); + + jac.set(V46, Cu59, 0.0); + + jac.set(V46, Zn60, 0.0); + + jac.set(V47, N, 0.0); + + scratch = -screened_rates(k_p_V47_to_Cr48_reaclib)*Y(V47)*state.rho - screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(V47)*state.rho; + jac.set(V47, H1, scratch); + + scratch = screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(Sc43)*state.rho + screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(Ti44)*state.rho - screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(V47)*state.rho; + jac.set(V47, He4, scratch); + + jac.set(V47, C12, 0.0); + + jac.set(V47, C13, 0.0); + + jac.set(V47, C14, 0.0); + + jac.set(V47, N13, 0.0); + + jac.set(V47, N14, 0.0); + + jac.set(V47, N15, 0.0); + + jac.set(V47, O16, 0.0); + + jac.set(V47, O17, 0.0); + + jac.set(V47, O18, 0.0); + + jac.set(V47, F18, 0.0); + + jac.set(V47, F19, 0.0); + + jac.set(V47, Ne20, 0.0); + + jac.set(V47, Ne21, 0.0); + + jac.set(V47, Ne22, 0.0); + + jac.set(V47, Na22, 0.0); + + jac.set(V47, Na23, 0.0); + + jac.set(V47, Mg24, 0.0); + + jac.set(V47, Mg25, 0.0); + + jac.set(V47, Al26, 0.0); + + jac.set(V47, Al27, 0.0); + + jac.set(V47, Si28, 0.0); + + jac.set(V47, Si29, 0.0); + + jac.set(V47, P30, 0.0); + + jac.set(V47, P31, 0.0); + + jac.set(V47, S32, 0.0); + + jac.set(V47, S33, 0.0); + + jac.set(V47, Cl34, 0.0); + + jac.set(V47, Cl35, 0.0); + + jac.set(V47, Ar36, 0.0); + + jac.set(V47, Ar37, 0.0); + + jac.set(V47, K38, 0.0); + + jac.set(V47, K39, 0.0); + + jac.set(V47, Ca40, 0.0); + + jac.set(V47, Ca41, 0.0); + + jac.set(V47, Sc42, 0.0); + + scratch = screened_rates(k_He4_Sc43_to_V47_reaclib)*Y(He4)*state.rho; + jac.set(V47, Sc43, scratch); + + scratch = screened_rates(k_He4_Ti44_to_p_V47_reaclib)*Y(He4)*state.rho; + jac.set(V47, Ti44, scratch); + + jac.set(V47, Ti45, 0.0); + + jac.set(V47, V46, 0.0); + + scratch = -screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(He4)*state.rho - screened_rates(k_V47_to_He4_Sc43_derived) - screened_rates(k_p_V47_to_Cr48_reaclib)*Y(H1)*state.rho - screened_rates(k_p_V47_to_He4_Ti44_derived)*Y(H1)*state.rho; + jac.set(V47, V47, scratch); + + scratch = screened_rates(k_Cr48_to_p_V47_derived); + jac.set(V47, Cr48, scratch); + + jac.set(V47, Cr49, 0.0); + + jac.set(V47, Mn50, 0.0); + + scratch = screened_rates(k_Mn51_to_He4_V47_derived); + jac.set(V47, Mn51, scratch); + + jac.set(V47, Mn52, 0.0); + + jac.set(V47, Fe52, 0.0); + + jac.set(V47, Fe53, 0.0); + + jac.set(V47, Fe54, 0.0); + + jac.set(V47, Fe55, 0.0); + + jac.set(V47, Fe56, 0.0); + + jac.set(V47, Co55, 0.0); + + jac.set(V47, Co56, 0.0); + + jac.set(V47, Co57, 0.0); + + jac.set(V47, Ni56, 0.0); + + jac.set(V47, Ni57, 0.0); + + jac.set(V47, Ni58, 0.0); + + jac.set(V47, Cu59, 0.0); + + jac.set(V47, Zn60, 0.0); + + jac.set(Cr48, N, 0.0); + + scratch = screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*state.rho + screened_rates(k_p_V47_to_Cr48_reaclib)*Y(V47)*state.rho; + jac.set(Cr48, H1, scratch); + + scratch = -screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(Cr48)*state.rho - screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*state.rho + screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(Ti44)*state.rho; + jac.set(Cr48, He4, scratch); + + jac.set(Cr48, C12, 0.0); + + jac.set(Cr48, C13, 0.0); + + jac.set(Cr48, C14, 0.0); + + jac.set(Cr48, N13, 0.0); + + jac.set(Cr48, N14, 0.0); + + jac.set(Cr48, N15, 0.0); + + jac.set(Cr48, O16, 0.0); + + jac.set(Cr48, O17, 0.0); + + jac.set(Cr48, O18, 0.0); + + jac.set(Cr48, F18, 0.0); + + jac.set(Cr48, F19, 0.0); + + jac.set(Cr48, Ne20, 0.0); + + jac.set(Cr48, Ne21, 0.0); + + jac.set(Cr48, Ne22, 0.0); + + jac.set(Cr48, Na22, 0.0); + + jac.set(Cr48, Na23, 0.0); + + jac.set(Cr48, Mg24, 0.0); + + jac.set(Cr48, Mg25, 0.0); + + jac.set(Cr48, Al26, 0.0); + + jac.set(Cr48, Al27, 0.0); + + jac.set(Cr48, Si28, 0.0); + + jac.set(Cr48, Si29, 0.0); + + jac.set(Cr48, P30, 0.0); + + jac.set(Cr48, P31, 0.0); + + jac.set(Cr48, S32, 0.0); + + jac.set(Cr48, S33, 0.0); + + jac.set(Cr48, Cl34, 0.0); + + jac.set(Cr48, Cl35, 0.0); + + jac.set(Cr48, Ar36, 0.0); + + jac.set(Cr48, Ar37, 0.0); + + jac.set(Cr48, K38, 0.0); + + jac.set(Cr48, K39, 0.0); + + jac.set(Cr48, Ca40, 0.0); + + jac.set(Cr48, Ca41, 0.0); + + jac.set(Cr48, Sc42, 0.0); + + jac.set(Cr48, Sc43, 0.0); + + scratch = screened_rates(k_He4_Ti44_to_Cr48_reaclib)*Y(He4)*state.rho; + jac.set(Cr48, Ti44, scratch); + + jac.set(Cr48, Ti45, 0.0); + + jac.set(Cr48, V46, 0.0); + + scratch = screened_rates(k_p_V47_to_Cr48_reaclib)*Y(H1)*state.rho; + jac.set(Cr48, V47, scratch); + + scratch = -screened_rates(k_Cr48_to_He4_Ti44_derived) - screened_rates(k_Cr48_to_p_V47_derived) - screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(He4)*state.rho; + jac.set(Cr48, Cr48, scratch); + + jac.set(Cr48, Cr49, 0.0); + + jac.set(Cr48, Mn50, 0.0); + + scratch = screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(H1)*state.rho; + jac.set(Cr48, Mn51, scratch); + + jac.set(Cr48, Mn52, 0.0); + + scratch = screened_rates(k_Fe52_to_He4_Cr48_derived); + jac.set(Cr48, Fe52, scratch); + + jac.set(Cr48, Fe53, 0.0); + + jac.set(Cr48, Fe54, 0.0); + + jac.set(Cr48, Fe55, 0.0); + + jac.set(Cr48, Fe56, 0.0); + + jac.set(Cr48, Co55, 0.0); + + jac.set(Cr48, Co56, 0.0); + + jac.set(Cr48, Co57, 0.0); + + jac.set(Cr48, Ni56, 0.0); + + jac.set(Cr48, Ni57, 0.0); + + jac.set(Cr48, Ni58, 0.0); + + jac.set(Cr48, Cu59, 0.0); + + jac.set(Cr48, Zn60, 0.0); + + jac.set(Cr49, N, 0.0); + + scratch = -screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(Cr49)*state.rho - screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(Cr49)*state.rho + screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*state.rho; + jac.set(Cr49, H1, scratch); + + scratch = -screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*state.rho + screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(Ti45)*state.rho + screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(V46)*state.rho; + jac.set(Cr49, He4, scratch); + + jac.set(Cr49, C12, 0.0); + + jac.set(Cr49, C13, 0.0); + + jac.set(Cr49, C14, 0.0); + + jac.set(Cr49, N13, 0.0); + + jac.set(Cr49, N14, 0.0); + + jac.set(Cr49, N15, 0.0); + + jac.set(Cr49, O16, 0.0); + + jac.set(Cr49, O17, 0.0); + + jac.set(Cr49, O18, 0.0); + + jac.set(Cr49, F18, 0.0); + + jac.set(Cr49, F19, 0.0); + + jac.set(Cr49, Ne20, 0.0); + + jac.set(Cr49, Ne21, 0.0); + + jac.set(Cr49, Ne22, 0.0); + + jac.set(Cr49, Na22, 0.0); + + jac.set(Cr49, Na23, 0.0); + + jac.set(Cr49, Mg24, 0.0); + + jac.set(Cr49, Mg25, 0.0); + + jac.set(Cr49, Al26, 0.0); + + jac.set(Cr49, Al27, 0.0); + + jac.set(Cr49, Si28, 0.0); + + jac.set(Cr49, Si29, 0.0); + + jac.set(Cr49, P30, 0.0); + + jac.set(Cr49, P31, 0.0); + + jac.set(Cr49, S32, 0.0); + + jac.set(Cr49, S33, 0.0); + + jac.set(Cr49, Cl34, 0.0); + + jac.set(Cr49, Cl35, 0.0); + + jac.set(Cr49, Ar36, 0.0); + + jac.set(Cr49, Ar37, 0.0); + + jac.set(Cr49, K38, 0.0); + + jac.set(Cr49, K39, 0.0); + + jac.set(Cr49, Ca40, 0.0); + + jac.set(Cr49, Ca41, 0.0); + + jac.set(Cr49, Sc42, 0.0); + + jac.set(Cr49, Sc43, 0.0); + + jac.set(Cr49, Ti44, 0.0); + + scratch = screened_rates(k_He4_Ti45_to_Cr49_reaclib)*Y(He4)*state.rho; + jac.set(Cr49, Ti45, scratch); + + scratch = screened_rates(k_He4_V46_to_p_Cr49_reaclib)*Y(He4)*state.rho; + jac.set(Cr49, V46, scratch); + + jac.set(Cr49, V47, 0.0); + + jac.set(Cr49, Cr48, 0.0); + + scratch = -screened_rates(k_Cr49_to_He4_Ti45_derived) - screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(He4)*state.rho - screened_rates(k_p_Cr49_to_He4_V46_derived)*Y(H1)*state.rho - screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(H1)*state.rho; + jac.set(Cr49, Cr49, scratch); + + scratch = screened_rates(k_Mn50_to_p_Cr49_derived); + jac.set(Cr49, Mn50, scratch); + + jac.set(Cr49, Mn51, 0.0); + + scratch = screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(H1)*state.rho; + jac.set(Cr49, Mn52, scratch); + + jac.set(Cr49, Fe52, 0.0); + + jac.set(Cr49, Fe53, 0.0); + + jac.set(Cr49, Fe54, 0.0); + + jac.set(Cr49, Fe55, 0.0); + + jac.set(Cr49, Fe56, 0.0); + + jac.set(Cr49, Co55, 0.0); + + jac.set(Cr49, Co56, 0.0); + + jac.set(Cr49, Co57, 0.0); + + jac.set(Cr49, Ni56, 0.0); + + jac.set(Cr49, Ni57, 0.0); + + jac.set(Cr49, Ni58, 0.0); + + jac.set(Cr49, Cu59, 0.0); + + jac.set(Cr49, Zn60, 0.0); + + scratch = -screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(Mn50)*state.rho; + jac.set(Mn50, N, scratch); + + scratch = screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(Cr49)*state.rho + screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*state.rho; + jac.set(Mn50, H1, scratch); + + scratch = -screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(Mn50)*state.rho + screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(V46)*state.rho; + jac.set(Mn50, He4, scratch); + + jac.set(Mn50, C12, 0.0); + + jac.set(Mn50, C13, 0.0); + + jac.set(Mn50, C14, 0.0); + + jac.set(Mn50, N13, 0.0); + + jac.set(Mn50, N14, 0.0); + + jac.set(Mn50, N15, 0.0); + + jac.set(Mn50, O16, 0.0); + + jac.set(Mn50, O17, 0.0); + + jac.set(Mn50, O18, 0.0); + + jac.set(Mn50, F18, 0.0); + + jac.set(Mn50, F19, 0.0); + + jac.set(Mn50, Ne20, 0.0); + + jac.set(Mn50, Ne21, 0.0); + + jac.set(Mn50, Ne22, 0.0); + + jac.set(Mn50, Na22, 0.0); + + jac.set(Mn50, Na23, 0.0); + + jac.set(Mn50, Mg24, 0.0); + + jac.set(Mn50, Mg25, 0.0); + + jac.set(Mn50, Al26, 0.0); + + jac.set(Mn50, Al27, 0.0); + + jac.set(Mn50, Si28, 0.0); + + jac.set(Mn50, Si29, 0.0); + + jac.set(Mn50, P30, 0.0); + + jac.set(Mn50, P31, 0.0); + + jac.set(Mn50, S32, 0.0); + + jac.set(Mn50, S33, 0.0); + + jac.set(Mn50, Cl34, 0.0); + + jac.set(Mn50, Cl35, 0.0); + + jac.set(Mn50, Ar36, 0.0); + + jac.set(Mn50, Ar37, 0.0); + + jac.set(Mn50, K38, 0.0); + + jac.set(Mn50, K39, 0.0); + + jac.set(Mn50, Ca40, 0.0); + + jac.set(Mn50, Ca41, 0.0); + + jac.set(Mn50, Sc42, 0.0); + + jac.set(Mn50, Sc43, 0.0); + + jac.set(Mn50, Ti44, 0.0); + + jac.set(Mn50, Ti45, 0.0); + + scratch = screened_rates(k_He4_V46_to_Mn50_reaclib)*Y(He4)*state.rho; + jac.set(Mn50, V46, scratch); + + jac.set(Mn50, V47, 0.0); + + jac.set(Mn50, Cr48, 0.0); + + scratch = screened_rates(k_p_Cr49_to_Mn50_reaclib)*Y(H1)*state.rho; + jac.set(Mn50, Cr49, scratch); + + scratch = -screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*state.rho - screened_rates(k_Mn50_to_He4_V46_derived) - screened_rates(k_Mn50_to_p_Cr49_derived) - screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(N)*state.rho; + jac.set(Mn50, Mn50, scratch); + + scratch = screened_rates(k_Mn51_to_n_Mn50_derived); + jac.set(Mn50, Mn51, scratch); + + jac.set(Mn50, Mn52, 0.0); + + jac.set(Mn50, Fe52, 0.0); + + scratch = screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(H1)*state.rho; + jac.set(Mn50, Fe53, scratch); + + jac.set(Mn50, Fe54, 0.0); + + jac.set(Mn50, Fe55, 0.0); + + jac.set(Mn50, Fe56, 0.0); + + jac.set(Mn50, Co55, 0.0); + + jac.set(Mn50, Co56, 0.0); + + jac.set(Mn50, Co57, 0.0); + + jac.set(Mn50, Ni56, 0.0); + + jac.set(Mn50, Ni57, 0.0); + + jac.set(Mn50, Ni58, 0.0); + + jac.set(Mn50, Cu59, 0.0); + + jac.set(Mn50, Zn60, 0.0); + + scratch = screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(Mn50)*state.rho - screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(Mn51)*state.rho; + jac.set(Mn51, N, scratch); + + scratch = screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*state.rho - screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(Mn51)*state.rho - screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(Mn51)*state.rho; + jac.set(Mn51, H1, scratch); + + scratch = screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(Cr48)*state.rho - screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(Mn51)*state.rho - screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(Mn51)*state.rho + screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(V47)*state.rho; + jac.set(Mn51, He4, scratch); + + jac.set(Mn51, C12, 0.0); + + jac.set(Mn51, C13, 0.0); + + jac.set(Mn51, C14, 0.0); + + jac.set(Mn51, N13, 0.0); + + jac.set(Mn51, N14, 0.0); + + jac.set(Mn51, N15, 0.0); + + jac.set(Mn51, O16, 0.0); + + jac.set(Mn51, O17, 0.0); + + jac.set(Mn51, O18, 0.0); + + jac.set(Mn51, F18, 0.0); + + jac.set(Mn51, F19, 0.0); + + jac.set(Mn51, Ne20, 0.0); + + jac.set(Mn51, Ne21, 0.0); + + jac.set(Mn51, Ne22, 0.0); + + jac.set(Mn51, Na22, 0.0); + + jac.set(Mn51, Na23, 0.0); + + jac.set(Mn51, Mg24, 0.0); + + jac.set(Mn51, Mg25, 0.0); + + jac.set(Mn51, Al26, 0.0); + + jac.set(Mn51, Al27, 0.0); + + jac.set(Mn51, Si28, 0.0); + + jac.set(Mn51, Si29, 0.0); + + jac.set(Mn51, P30, 0.0); + + jac.set(Mn51, P31, 0.0); + + jac.set(Mn51, S32, 0.0); + + jac.set(Mn51, S33, 0.0); + + jac.set(Mn51, Cl34, 0.0); + + jac.set(Mn51, Cl35, 0.0); + + jac.set(Mn51, Ar36, 0.0); + + jac.set(Mn51, Ar37, 0.0); + + jac.set(Mn51, K38, 0.0); + + jac.set(Mn51, K39, 0.0); + + jac.set(Mn51, Ca40, 0.0); + + jac.set(Mn51, Ca41, 0.0); + + jac.set(Mn51, Sc42, 0.0); + + jac.set(Mn51, Sc43, 0.0); + + jac.set(Mn51, Ti44, 0.0); + + jac.set(Mn51, Ti45, 0.0); + + jac.set(Mn51, V46, 0.0); + + scratch = screened_rates(k_He4_V47_to_Mn51_reaclib)*Y(He4)*state.rho; + jac.set(Mn51, V47, scratch); + + scratch = screened_rates(k_He4_Cr48_to_p_Mn51_reaclib)*Y(He4)*state.rho; + jac.set(Mn51, Cr48, scratch); + + jac.set(Mn51, Cr49, 0.0); + + scratch = screened_rates(k_n_Mn50_to_Mn51_reaclib)*Y(N)*state.rho; + jac.set(Mn51, Mn50, scratch); + + scratch = -screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*state.rho - screened_rates(k_Mn51_to_He4_V47_derived) - screened_rates(k_Mn51_to_n_Mn50_derived) - screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(N)*state.rho - screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Mn51_to_He4_Cr48_derived)*Y(H1)*state.rho; + jac.set(Mn51, Mn51, scratch); + + scratch = screened_rates(k_Mn52_to_n_Mn51_derived); + jac.set(Mn51, Mn52, scratch); + + scratch = screened_rates(k_Fe52_to_p_Mn51_derived); + jac.set(Mn51, Fe52, scratch); + + jac.set(Mn51, Fe53, 0.0); + + scratch = screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(H1)*state.rho; + jac.set(Mn51, Fe54, scratch); + + jac.set(Mn51, Fe55, 0.0); + + jac.set(Mn51, Fe56, 0.0); + + scratch = screened_rates(k_Co55_to_He4_Mn51_derived); + jac.set(Mn51, Co55, scratch); + + jac.set(Mn51, Co56, 0.0); + + jac.set(Mn51, Co57, 0.0); + + jac.set(Mn51, Ni56, 0.0); + + jac.set(Mn51, Ni57, 0.0); + + jac.set(Mn51, Ni58, 0.0); + + jac.set(Mn51, Cu59, 0.0); + + jac.set(Mn51, Zn60, 0.0); + + scratch = screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*state.rho + screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*state.rho + screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(Mn51)*state.rho; + jac.set(Mn52, N, scratch); + + scratch = screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*state.rho - screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(Mn52)*state.rho - screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(Mn52)*state.rho - screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*state.rho; + jac.set(Mn52, H1, scratch); + + scratch = screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(Cr49)*state.rho - screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(Mn52)*state.rho - screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(Mn52)*state.rho - screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(Mn52)*state.rho; + jac.set(Mn52, He4, scratch); + + jac.set(Mn52, C12, 0.0); + + jac.set(Mn52, C13, 0.0); + + jac.set(Mn52, C14, 0.0); + + jac.set(Mn52, N13, 0.0); + + jac.set(Mn52, N14, 0.0); + + jac.set(Mn52, N15, 0.0); + + jac.set(Mn52, O16, 0.0); + + jac.set(Mn52, O17, 0.0); + + jac.set(Mn52, O18, 0.0); + + jac.set(Mn52, F18, 0.0); + + jac.set(Mn52, F19, 0.0); + + jac.set(Mn52, Ne20, 0.0); + + jac.set(Mn52, Ne21, 0.0); + + jac.set(Mn52, Ne22, 0.0); + + jac.set(Mn52, Na22, 0.0); + + jac.set(Mn52, Na23, 0.0); + + jac.set(Mn52, Mg24, 0.0); + + jac.set(Mn52, Mg25, 0.0); + + jac.set(Mn52, Al26, 0.0); + + jac.set(Mn52, Al27, 0.0); + + jac.set(Mn52, Si28, 0.0); + + jac.set(Mn52, Si29, 0.0); + + jac.set(Mn52, P30, 0.0); + + jac.set(Mn52, P31, 0.0); + + jac.set(Mn52, S32, 0.0); + + jac.set(Mn52, S33, 0.0); + + jac.set(Mn52, Cl34, 0.0); + + jac.set(Mn52, Cl35, 0.0); + + jac.set(Mn52, Ar36, 0.0); + + jac.set(Mn52, Ar37, 0.0); + + jac.set(Mn52, K38, 0.0); + + jac.set(Mn52, K39, 0.0); + + jac.set(Mn52, Ca40, 0.0); + + jac.set(Mn52, Ca41, 0.0); + + jac.set(Mn52, Sc42, 0.0); + + jac.set(Mn52, Sc43, 0.0); + + jac.set(Mn52, Ti44, 0.0); + + jac.set(Mn52, Ti45, 0.0); + + jac.set(Mn52, V46, 0.0); + + jac.set(Mn52, V47, 0.0); + + jac.set(Mn52, Cr48, 0.0); + + scratch = screened_rates(k_He4_Cr49_to_p_Mn52_reaclib)*Y(He4)*state.rho; + jac.set(Mn52, Cr49, scratch); + + jac.set(Mn52, Mn50, 0.0); + + scratch = screened_rates(k_n_Mn51_to_Mn52_reaclib)*Y(N)*state.rho; + jac.set(Mn52, Mn51, scratch); + + scratch = -screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*state.rho - screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*state.rho - screened_rates(k_Mn52_to_Fe52_weaktab) - screened_rates(k_Mn52_to_n_Mn51_derived) - screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Mn52_to_He4_Cr49_derived)*Y(H1)*state.rho - screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(H1)*state.rho; + jac.set(Mn52, Mn52, scratch); + + scratch = screened_rates(k_Fe52_to_Mn52_weaktab) + screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(N)*state.rho; + jac.set(Mn52, Fe52, scratch); + + scratch = screened_rates(k_Fe53_to_p_Mn52_derived); + jac.set(Mn52, Fe53, scratch); + + jac.set(Mn52, Fe54, 0.0); + + scratch = screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(H1)*state.rho; + jac.set(Mn52, Fe55, scratch); + + jac.set(Mn52, Fe56, 0.0); + + scratch = screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(N)*state.rho; + jac.set(Mn52, Co55, scratch); + + scratch = screened_rates(k_Co56_to_He4_Mn52_derived); + jac.set(Mn52, Co56, scratch); + + jac.set(Mn52, Co57, 0.0); + + jac.set(Mn52, Ni56, 0.0); + + jac.set(Mn52, Ni57, 0.0); + + jac.set(Mn52, Ni58, 0.0); + + jac.set(Mn52, Cu59, 0.0); + + jac.set(Mn52, Zn60, 0.0); + + scratch = -screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(Fe52)*state.rho - screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(Fe52)*state.rho; + jac.set(Fe52, N, scratch); + + scratch = screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*state.rho + screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(Mn51)*state.rho + screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(Mn52)*state.rho; + jac.set(Fe52, H1, scratch); + + scratch = screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(Cr48)*state.rho - screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(Fe52)*state.rho - screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*state.rho; + jac.set(Fe52, He4, scratch); + + jac.set(Fe52, C12, 0.0); + + jac.set(Fe52, C13, 0.0); + + jac.set(Fe52, C14, 0.0); + + jac.set(Fe52, N13, 0.0); + + jac.set(Fe52, N14, 0.0); + + jac.set(Fe52, N15, 0.0); + + jac.set(Fe52, O16, 0.0); + + jac.set(Fe52, O17, 0.0); + + jac.set(Fe52, O18, 0.0); + + jac.set(Fe52, F18, 0.0); + + jac.set(Fe52, F19, 0.0); + + jac.set(Fe52, Ne20, 0.0); + + jac.set(Fe52, Ne21, 0.0); + + jac.set(Fe52, Ne22, 0.0); + + jac.set(Fe52, Na22, 0.0); + + jac.set(Fe52, Na23, 0.0); + + jac.set(Fe52, Mg24, 0.0); + + jac.set(Fe52, Mg25, 0.0); + + jac.set(Fe52, Al26, 0.0); + + jac.set(Fe52, Al27, 0.0); + + jac.set(Fe52, Si28, 0.0); + + jac.set(Fe52, Si29, 0.0); + + jac.set(Fe52, P30, 0.0); + + jac.set(Fe52, P31, 0.0); + + jac.set(Fe52, S32, 0.0); + + jac.set(Fe52, S33, 0.0); + + jac.set(Fe52, Cl34, 0.0); + + jac.set(Fe52, Cl35, 0.0); + + jac.set(Fe52, Ar36, 0.0); + + jac.set(Fe52, Ar37, 0.0); + + jac.set(Fe52, K38, 0.0); + + jac.set(Fe52, K39, 0.0); + + jac.set(Fe52, Ca40, 0.0); + + jac.set(Fe52, Ca41, 0.0); + + jac.set(Fe52, Sc42, 0.0); + + jac.set(Fe52, Sc43, 0.0); + + jac.set(Fe52, Ti44, 0.0); + + jac.set(Fe52, Ti45, 0.0); + + jac.set(Fe52, V46, 0.0); + + jac.set(Fe52, V47, 0.0); + + scratch = screened_rates(k_He4_Cr48_to_Fe52_reaclib)*Y(He4)*state.rho; + jac.set(Fe52, Cr48, scratch); + + jac.set(Fe52, Cr49, 0.0); + + jac.set(Fe52, Mn50, 0.0); + + scratch = screened_rates(k_p_Mn51_to_Fe52_reaclib)*Y(H1)*state.rho; + jac.set(Fe52, Mn51, scratch); + + scratch = screened_rates(k_Mn52_to_Fe52_weaktab) + screened_rates(k_p_Mn52_to_n_Fe52_derived)*Y(H1)*state.rho; + jac.set(Fe52, Mn52, scratch); + + scratch = -screened_rates(k_Fe52_to_He4_Cr48_derived) - screened_rates(k_Fe52_to_Mn52_weaktab) - screened_rates(k_Fe52_to_p_Mn51_derived) - screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(He4)*state.rho - screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(N)*state.rho - screened_rates(k_n_Fe52_to_p_Mn52_reaclib)*Y(N)*state.rho; + jac.set(Fe52, Fe52, scratch); + + scratch = screened_rates(k_Fe53_to_n_Fe52_derived); + jac.set(Fe52, Fe53, scratch); + + jac.set(Fe52, Fe54, 0.0); + + jac.set(Fe52, Fe55, 0.0); + + jac.set(Fe52, Fe56, 0.0); + + scratch = screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(H1)*state.rho; + jac.set(Fe52, Co55, scratch); + + jac.set(Fe52, Co56, 0.0); + + jac.set(Fe52, Co57, 0.0); + + scratch = screened_rates(k_Ni56_to_He4_Fe52_derived); + jac.set(Fe52, Ni56, scratch); + + jac.set(Fe52, Ni57, 0.0); + + jac.set(Fe52, Ni58, 0.0); + + jac.set(Fe52, Cu59, 0.0); + + jac.set(Fe52, Zn60, 0.0); + + scratch = screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(Fe52)*state.rho - screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(Fe53)*state.rho + screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*state.rho; + jac.set(Fe53, N, scratch); + + scratch = screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*state.rho - screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(Fe53)*state.rho + screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(Mn52)*state.rho; + jac.set(Fe53, H1, scratch); + + scratch = -screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(Fe53)*state.rho - screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*state.rho + screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(Mn50)*state.rho; + jac.set(Fe53, He4, scratch); + + jac.set(Fe53, C12, 0.0); + + jac.set(Fe53, C13, 0.0); + + jac.set(Fe53, C14, 0.0); + + jac.set(Fe53, N13, 0.0); + + jac.set(Fe53, N14, 0.0); + + jac.set(Fe53, N15, 0.0); + + jac.set(Fe53, O16, 0.0); + + jac.set(Fe53, O17, 0.0); + + jac.set(Fe53, O18, 0.0); + + jac.set(Fe53, F18, 0.0); + + jac.set(Fe53, F19, 0.0); + + jac.set(Fe53, Ne20, 0.0); + + jac.set(Fe53, Ne21, 0.0); + + jac.set(Fe53, Ne22, 0.0); + + jac.set(Fe53, Na22, 0.0); + + jac.set(Fe53, Na23, 0.0); + + jac.set(Fe53, Mg24, 0.0); + + jac.set(Fe53, Mg25, 0.0); + + jac.set(Fe53, Al26, 0.0); + + jac.set(Fe53, Al27, 0.0); + + jac.set(Fe53, Si28, 0.0); + + jac.set(Fe53, Si29, 0.0); + + jac.set(Fe53, P30, 0.0); + + jac.set(Fe53, P31, 0.0); + + jac.set(Fe53, S32, 0.0); + + jac.set(Fe53, S33, 0.0); + + jac.set(Fe53, Cl34, 0.0); + + jac.set(Fe53, Cl35, 0.0); + + jac.set(Fe53, Ar36, 0.0); + + jac.set(Fe53, Ar37, 0.0); + + jac.set(Fe53, K38, 0.0); + + jac.set(Fe53, K39, 0.0); + + jac.set(Fe53, Ca40, 0.0); + + jac.set(Fe53, Ca41, 0.0); + + jac.set(Fe53, Sc42, 0.0); + + jac.set(Fe53, Sc43, 0.0); + + jac.set(Fe53, Ti44, 0.0); + + jac.set(Fe53, Ti45, 0.0); + + jac.set(Fe53, V46, 0.0); + + jac.set(Fe53, V47, 0.0); + + jac.set(Fe53, Cr48, 0.0); + + jac.set(Fe53, Cr49, 0.0); + + scratch = screened_rates(k_He4_Mn50_to_p_Fe53_reaclib)*Y(He4)*state.rho; + jac.set(Fe53, Mn50, scratch); + + jac.set(Fe53, Mn51, 0.0); + + scratch = screened_rates(k_p_Mn52_to_Fe53_reaclib)*Y(H1)*state.rho; + jac.set(Fe53, Mn52, scratch); + + scratch = screened_rates(k_n_Fe52_to_Fe53_reaclib)*Y(N)*state.rho; + jac.set(Fe53, Fe52, scratch); + + scratch = -screened_rates(k_Fe53_to_n_Fe52_derived) - screened_rates(k_Fe53_to_p_Mn52_derived) - screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(He4)*state.rho - screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(He4)*state.rho - screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(N)*state.rho - screened_rates(k_p_Fe53_to_He4_Mn50_derived)*Y(H1)*state.rho; + jac.set(Fe53, Fe53, scratch); + + scratch = screened_rates(k_Fe54_to_n_Fe53_derived); + jac.set(Fe53, Fe54, scratch); + + jac.set(Fe53, Fe55, 0.0); + + jac.set(Fe53, Fe56, 0.0); + + jac.set(Fe53, Co55, 0.0); + + scratch = screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(H1)*state.rho; + jac.set(Fe53, Co56, scratch); + + jac.set(Fe53, Co57, 0.0); + + scratch = screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(N)*state.rho; + jac.set(Fe53, Ni56, scratch); + + scratch = screened_rates(k_Ni57_to_He4_Fe53_derived); + jac.set(Fe53, Ni57, scratch); + + jac.set(Fe53, Ni58, 0.0); + + jac.set(Fe53, Cu59, 0.0); + + jac.set(Fe53, Zn60, 0.0); + + scratch = screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(Fe53)*state.rho - screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(Fe54)*state.rho + screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*state.rho; + jac.set(Fe54, N, scratch); + + scratch = screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*state.rho - screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(Fe54)*state.rho - screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(Fe54)*state.rho; + jac.set(Fe54, H1, scratch); + + scratch = -screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(Fe54)*state.rho - screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*state.rho + screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(Mn51)*state.rho; + jac.set(Fe54, He4, scratch); + + jac.set(Fe54, C12, 0.0); + + jac.set(Fe54, C13, 0.0); + + jac.set(Fe54, C14, 0.0); + + jac.set(Fe54, N13, 0.0); + + jac.set(Fe54, N14, 0.0); + + jac.set(Fe54, N15, 0.0); + + jac.set(Fe54, O16, 0.0); + + jac.set(Fe54, O17, 0.0); + + jac.set(Fe54, O18, 0.0); + + jac.set(Fe54, F18, 0.0); + + jac.set(Fe54, F19, 0.0); + + jac.set(Fe54, Ne20, 0.0); + + jac.set(Fe54, Ne21, 0.0); + + jac.set(Fe54, Ne22, 0.0); + + jac.set(Fe54, Na22, 0.0); + + jac.set(Fe54, Na23, 0.0); + + jac.set(Fe54, Mg24, 0.0); + + jac.set(Fe54, Mg25, 0.0); + + jac.set(Fe54, Al26, 0.0); + + jac.set(Fe54, Al27, 0.0); + + jac.set(Fe54, Si28, 0.0); + + jac.set(Fe54, Si29, 0.0); + + jac.set(Fe54, P30, 0.0); + + jac.set(Fe54, P31, 0.0); + + jac.set(Fe54, S32, 0.0); + + jac.set(Fe54, S33, 0.0); + + jac.set(Fe54, Cl34, 0.0); + + jac.set(Fe54, Cl35, 0.0); + + jac.set(Fe54, Ar36, 0.0); + + jac.set(Fe54, Ar37, 0.0); + + jac.set(Fe54, K38, 0.0); + + jac.set(Fe54, K39, 0.0); + + jac.set(Fe54, Ca40, 0.0); + + jac.set(Fe54, Ca41, 0.0); + + jac.set(Fe54, Sc42, 0.0); + + jac.set(Fe54, Sc43, 0.0); + + jac.set(Fe54, Ti44, 0.0); + + jac.set(Fe54, Ti45, 0.0); + + jac.set(Fe54, V46, 0.0); + + jac.set(Fe54, V47, 0.0); + + jac.set(Fe54, Cr48, 0.0); + + jac.set(Fe54, Cr49, 0.0); + + jac.set(Fe54, Mn50, 0.0); + + scratch = screened_rates(k_He4_Mn51_to_p_Fe54_reaclib)*Y(He4)*state.rho; + jac.set(Fe54, Mn51, scratch); + + jac.set(Fe54, Mn52, 0.0); + + jac.set(Fe54, Fe52, 0.0); + + scratch = screened_rates(k_n_Fe53_to_Fe54_reaclib)*Y(N)*state.rho; + jac.set(Fe54, Fe53, scratch); + + scratch = -screened_rates(k_Fe54_to_n_Fe53_derived) - screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(He4)*state.rho - screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(He4)*state.rho - screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(N)*state.rho - screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Fe54_to_He4_Mn51_derived)*Y(H1)*state.rho; + jac.set(Fe54, Fe54, scratch); + + scratch = screened_rates(k_Fe55_to_n_Fe54_derived); + jac.set(Fe54, Fe55, scratch); + + jac.set(Fe54, Fe56, 0.0); + + scratch = screened_rates(k_Co55_to_p_Fe54_derived); + jac.set(Fe54, Co55, scratch); + + jac.set(Fe54, Co56, 0.0); + + scratch = screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(H1)*state.rho; + jac.set(Fe54, Co57, scratch); + + jac.set(Fe54, Ni56, 0.0); + + scratch = screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(N)*state.rho; + jac.set(Fe54, Ni57, scratch); + + scratch = screened_rates(k_Ni58_to_He4_Fe54_derived); + jac.set(Fe54, Ni58, scratch); + + jac.set(Fe54, Cu59, 0.0); + + jac.set(Fe54, Zn60, 0.0); + + scratch = screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*state.rho + screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(Fe54)*state.rho - screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(Fe55)*state.rho + screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*state.rho; + jac.set(Fe55, N, scratch); + + scratch = -screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(Fe55)*state.rho - screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(Fe55)*state.rho - screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*state.rho; + jac.set(Fe55, H1, scratch); + + scratch = -screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*state.rho + screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(Mn52)*state.rho; + jac.set(Fe55, He4, scratch); + + jac.set(Fe55, C12, 0.0); + + jac.set(Fe55, C13, 0.0); + + jac.set(Fe55, C14, 0.0); + + jac.set(Fe55, N13, 0.0); + + jac.set(Fe55, N14, 0.0); + + jac.set(Fe55, N15, 0.0); + + jac.set(Fe55, O16, 0.0); + + jac.set(Fe55, O17, 0.0); + + jac.set(Fe55, O18, 0.0); + + jac.set(Fe55, F18, 0.0); + + jac.set(Fe55, F19, 0.0); + + jac.set(Fe55, Ne20, 0.0); + + jac.set(Fe55, Ne21, 0.0); + + jac.set(Fe55, Ne22, 0.0); + + jac.set(Fe55, Na22, 0.0); + + jac.set(Fe55, Na23, 0.0); + + jac.set(Fe55, Mg24, 0.0); + + jac.set(Fe55, Mg25, 0.0); + + jac.set(Fe55, Al26, 0.0); + + jac.set(Fe55, Al27, 0.0); + + jac.set(Fe55, Si28, 0.0); + + jac.set(Fe55, Si29, 0.0); + + jac.set(Fe55, P30, 0.0); + + jac.set(Fe55, P31, 0.0); + + jac.set(Fe55, S32, 0.0); + + jac.set(Fe55, S33, 0.0); + + jac.set(Fe55, Cl34, 0.0); + + jac.set(Fe55, Cl35, 0.0); + + jac.set(Fe55, Ar36, 0.0); + + jac.set(Fe55, Ar37, 0.0); + + jac.set(Fe55, K38, 0.0); + + jac.set(Fe55, K39, 0.0); + + jac.set(Fe55, Ca40, 0.0); + + jac.set(Fe55, Ca41, 0.0); + + jac.set(Fe55, Sc42, 0.0); + + jac.set(Fe55, Sc43, 0.0); + + jac.set(Fe55, Ti44, 0.0); + + jac.set(Fe55, Ti45, 0.0); + + jac.set(Fe55, V46, 0.0); + + jac.set(Fe55, V47, 0.0); + + jac.set(Fe55, Cr48, 0.0); + + jac.set(Fe55, Cr49, 0.0); + + jac.set(Fe55, Mn50, 0.0); + + jac.set(Fe55, Mn51, 0.0); + + scratch = screened_rates(k_He4_Mn52_to_p_Fe55_reaclib)*Y(He4)*state.rho; + jac.set(Fe55, Mn52, scratch); + + jac.set(Fe55, Fe52, 0.0); + + jac.set(Fe55, Fe53, 0.0); + + scratch = screened_rates(k_n_Fe54_to_Fe55_reaclib)*Y(N)*state.rho; + jac.set(Fe55, Fe54, scratch); + + scratch = -screened_rates(k_Fe55_to_Co55_weaktab) - screened_rates(k_Fe55_to_n_Fe54_derived) - screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(He4)*state.rho - screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(N)*state.rho - screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Fe55_to_He4_Mn52_derived)*Y(H1)*state.rho - screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(H1)*state.rho; + jac.set(Fe55, Fe55, scratch); + + scratch = screened_rates(k_Fe56_to_n_Fe55_derived); + jac.set(Fe55, Fe56, scratch); + + scratch = screened_rates(k_Co55_to_Fe55_weaktab) + screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(N)*state.rho; + jac.set(Fe55, Co55, scratch); + + scratch = screened_rates(k_Co56_to_p_Fe55_derived); + jac.set(Fe55, Co56, scratch); + + jac.set(Fe55, Co57, 0.0); + + jac.set(Fe55, Ni56, 0.0); + + jac.set(Fe55, Ni57, 0.0); + + scratch = screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(N)*state.rho; + jac.set(Fe55, Ni58, scratch); + + jac.set(Fe55, Cu59, 0.0); + + jac.set(Fe55, Zn60, 0.0); + + scratch = screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*state.rho + screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(Fe55)*state.rho; + jac.set(Fe56, N, scratch); + + scratch = -screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(Fe56)*state.rho - screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*state.rho; + jac.set(Fe56, H1, scratch); + + jac.set(Fe56, He4, 0.0); + + jac.set(Fe56, C12, 0.0); + + jac.set(Fe56, C13, 0.0); + + jac.set(Fe56, C14, 0.0); + + jac.set(Fe56, N13, 0.0); + + jac.set(Fe56, N14, 0.0); + + jac.set(Fe56, N15, 0.0); + + jac.set(Fe56, O16, 0.0); + + jac.set(Fe56, O17, 0.0); + + jac.set(Fe56, O18, 0.0); + + jac.set(Fe56, F18, 0.0); + + jac.set(Fe56, F19, 0.0); + + jac.set(Fe56, Ne20, 0.0); + + jac.set(Fe56, Ne21, 0.0); + + jac.set(Fe56, Ne22, 0.0); + + jac.set(Fe56, Na22, 0.0); + + jac.set(Fe56, Na23, 0.0); + + jac.set(Fe56, Mg24, 0.0); + + jac.set(Fe56, Mg25, 0.0); + + jac.set(Fe56, Al26, 0.0); + + jac.set(Fe56, Al27, 0.0); + + jac.set(Fe56, Si28, 0.0); + + jac.set(Fe56, Si29, 0.0); + + jac.set(Fe56, P30, 0.0); + + jac.set(Fe56, P31, 0.0); + + jac.set(Fe56, S32, 0.0); + + jac.set(Fe56, S33, 0.0); + + jac.set(Fe56, Cl34, 0.0); + + jac.set(Fe56, Cl35, 0.0); + + jac.set(Fe56, Ar36, 0.0); + + jac.set(Fe56, Ar37, 0.0); + + jac.set(Fe56, K38, 0.0); + + jac.set(Fe56, K39, 0.0); + + jac.set(Fe56, Ca40, 0.0); + + jac.set(Fe56, Ca41, 0.0); + + jac.set(Fe56, Sc42, 0.0); + + jac.set(Fe56, Sc43, 0.0); + + jac.set(Fe56, Ti44, 0.0); + + jac.set(Fe56, Ti45, 0.0); + + jac.set(Fe56, V46, 0.0); + + jac.set(Fe56, V47, 0.0); + + jac.set(Fe56, Cr48, 0.0); + + jac.set(Fe56, Cr49, 0.0); + + jac.set(Fe56, Mn50, 0.0); + + jac.set(Fe56, Mn51, 0.0); + + jac.set(Fe56, Mn52, 0.0); + + jac.set(Fe56, Fe52, 0.0); + + jac.set(Fe56, Fe53, 0.0); + + jac.set(Fe56, Fe54, 0.0); + + scratch = screened_rates(k_n_Fe55_to_Fe56_reaclib)*Y(N)*state.rho; + jac.set(Fe56, Fe55, scratch); + + scratch = -screened_rates(k_Fe56_to_Co56_weaktab) - screened_rates(k_Fe56_to_n_Fe55_derived) - screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(H1)*state.rho; + jac.set(Fe56, Fe56, scratch); + + jac.set(Fe56, Co55, 0.0); + + scratch = screened_rates(k_Co56_to_Fe56_weaktab) + screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(N)*state.rho; + jac.set(Fe56, Co56, scratch); + + scratch = screened_rates(k_Co57_to_p_Fe56_derived); + jac.set(Fe56, Co57, scratch); + + jac.set(Fe56, Ni56, 0.0); + + jac.set(Fe56, Ni57, 0.0); + + jac.set(Fe56, Ni58, 0.0); + + jac.set(Fe56, Cu59, 0.0); + + jac.set(Fe56, Zn60, 0.0); + + scratch = -screened_rates(k_n_Co55_to_Co56_reaclib)*Y(Co55)*state.rho - screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(Co55)*state.rho - screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(Co55)*state.rho; + jac.set(Co55, N, scratch); + + scratch = -screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(Co55)*state.rho - screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(Co55)*state.rho + screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(Fe54)*state.rho + screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*state.rho; + jac.set(Co55, H1, scratch); + + scratch = -screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(Co55)*state.rho - screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*state.rho + screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(Fe52)*state.rho + screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(Mn51)*state.rho + screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(Mn52)*state.rho; + jac.set(Co55, He4, scratch); + + jac.set(Co55, C12, 0.0); + + jac.set(Co55, C13, 0.0); + + jac.set(Co55, C14, 0.0); + + jac.set(Co55, N13, 0.0); + + jac.set(Co55, N14, 0.0); + + jac.set(Co55, N15, 0.0); + + jac.set(Co55, O16, 0.0); + + jac.set(Co55, O17, 0.0); + + jac.set(Co55, O18, 0.0); + + jac.set(Co55, F18, 0.0); + + jac.set(Co55, F19, 0.0); + + jac.set(Co55, Ne20, 0.0); + + jac.set(Co55, Ne21, 0.0); + + jac.set(Co55, Ne22, 0.0); + + jac.set(Co55, Na22, 0.0); + + jac.set(Co55, Na23, 0.0); + + jac.set(Co55, Mg24, 0.0); + + jac.set(Co55, Mg25, 0.0); + + jac.set(Co55, Al26, 0.0); + + jac.set(Co55, Al27, 0.0); + + jac.set(Co55, Si28, 0.0); + + jac.set(Co55, Si29, 0.0); + + jac.set(Co55, P30, 0.0); + + jac.set(Co55, P31, 0.0); + + jac.set(Co55, S32, 0.0); + + jac.set(Co55, S33, 0.0); + + jac.set(Co55, Cl34, 0.0); + + jac.set(Co55, Cl35, 0.0); + + jac.set(Co55, Ar36, 0.0); + + jac.set(Co55, Ar37, 0.0); + + jac.set(Co55, K38, 0.0); + + jac.set(Co55, K39, 0.0); + + jac.set(Co55, Ca40, 0.0); + + jac.set(Co55, Ca41, 0.0); + + jac.set(Co55, Sc42, 0.0); + + jac.set(Co55, Sc43, 0.0); + + jac.set(Co55, Ti44, 0.0); + + jac.set(Co55, Ti45, 0.0); + + jac.set(Co55, V46, 0.0); + + jac.set(Co55, V47, 0.0); + + jac.set(Co55, Cr48, 0.0); + + jac.set(Co55, Cr49, 0.0); + + jac.set(Co55, Mn50, 0.0); + + scratch = screened_rates(k_He4_Mn51_to_Co55_reaclib)*Y(He4)*state.rho; + jac.set(Co55, Mn51, scratch); + + scratch = screened_rates(k_He4_Mn52_to_n_Co55_derived)*Y(He4)*state.rho; + jac.set(Co55, Mn52, scratch); + + scratch = screened_rates(k_He4_Fe52_to_p_Co55_reaclib)*Y(He4)*state.rho; + jac.set(Co55, Fe52, scratch); + + jac.set(Co55, Fe53, 0.0); + + scratch = screened_rates(k_p_Fe54_to_Co55_reaclib)*Y(H1)*state.rho; + jac.set(Co55, Fe54, scratch); + + scratch = screened_rates(k_Fe55_to_Co55_weaktab) + screened_rates(k_p_Fe55_to_n_Co55_derived)*Y(H1)*state.rho; + jac.set(Co55, Fe55, scratch); + + jac.set(Co55, Fe56, 0.0); + + scratch = -screened_rates(k_Co55_to_Fe55_weaktab) - screened_rates(k_Co55_to_He4_Mn51_derived) - screened_rates(k_Co55_to_p_Fe54_derived) - screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(He4)*state.rho - screened_rates(k_n_Co55_to_Co56_reaclib)*Y(N)*state.rho - screened_rates(k_n_Co55_to_He4_Mn52_reaclib)*Y(N)*state.rho - screened_rates(k_n_Co55_to_p_Fe55_reaclib)*Y(N)*state.rho - screened_rates(k_p_Co55_to_He4_Fe52_derived)*Y(H1)*state.rho - screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(H1)*state.rho; + jac.set(Co55, Co55, scratch); + + scratch = screened_rates(k_Co56_to_n_Co55_derived); + jac.set(Co55, Co56, scratch); + + jac.set(Co55, Co57, 0.0); + + scratch = screened_rates(k_Ni56_to_p_Co55_derived); + jac.set(Co55, Ni56, scratch); + + jac.set(Co55, Ni57, 0.0); + + scratch = screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(H1)*state.rho; + jac.set(Co55, Ni58, scratch); + + scratch = screened_rates(k_Cu59_to_He4_Co55_derived); + jac.set(Co55, Cu59, scratch); + + jac.set(Co55, Zn60, 0.0); + + scratch = screened_rates(k_n_Co55_to_Co56_reaclib)*Y(Co55)*state.rho - screened_rates(k_n_Co56_to_Co57_reaclib)*Y(Co56)*state.rho - screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(Co56)*state.rho + screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*state.rho + screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*state.rho; + jac.set(Co56, N, scratch); + + scratch = -screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(Co56)*state.rho - screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(Co56)*state.rho - screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*state.rho + screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(Fe55)*state.rho + screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(Fe56)*state.rho; + jac.set(Co56, H1, scratch); + + scratch = -screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*state.rho + screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(Fe53)*state.rho + screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(Mn52)*state.rho; + jac.set(Co56, He4, scratch); + + jac.set(Co56, C12, 0.0); + + jac.set(Co56, C13, 0.0); + + jac.set(Co56, C14, 0.0); + + jac.set(Co56, N13, 0.0); + + jac.set(Co56, N14, 0.0); + + jac.set(Co56, N15, 0.0); + + jac.set(Co56, O16, 0.0); + + jac.set(Co56, O17, 0.0); + + jac.set(Co56, O18, 0.0); + + jac.set(Co56, F18, 0.0); + + jac.set(Co56, F19, 0.0); + + jac.set(Co56, Ne20, 0.0); + + jac.set(Co56, Ne21, 0.0); + + jac.set(Co56, Ne22, 0.0); + + jac.set(Co56, Na22, 0.0); + + jac.set(Co56, Na23, 0.0); + + jac.set(Co56, Mg24, 0.0); + + jac.set(Co56, Mg25, 0.0); + + jac.set(Co56, Al26, 0.0); + + jac.set(Co56, Al27, 0.0); + + jac.set(Co56, Si28, 0.0); + + jac.set(Co56, Si29, 0.0); + + jac.set(Co56, P30, 0.0); + + jac.set(Co56, P31, 0.0); + + jac.set(Co56, S32, 0.0); + + jac.set(Co56, S33, 0.0); + + jac.set(Co56, Cl34, 0.0); + + jac.set(Co56, Cl35, 0.0); + + jac.set(Co56, Ar36, 0.0); + + jac.set(Co56, Ar37, 0.0); + + jac.set(Co56, K38, 0.0); + + jac.set(Co56, K39, 0.0); + + jac.set(Co56, Ca40, 0.0); + + jac.set(Co56, Ca41, 0.0); + + jac.set(Co56, Sc42, 0.0); + + jac.set(Co56, Sc43, 0.0); + + jac.set(Co56, Ti44, 0.0); + + jac.set(Co56, Ti45, 0.0); + + jac.set(Co56, V46, 0.0); + + jac.set(Co56, V47, 0.0); + + jac.set(Co56, Cr48, 0.0); + + jac.set(Co56, Cr49, 0.0); + + jac.set(Co56, Mn50, 0.0); + + jac.set(Co56, Mn51, 0.0); + + scratch = screened_rates(k_He4_Mn52_to_Co56_reaclib)*Y(He4)*state.rho; + jac.set(Co56, Mn52, scratch); + + jac.set(Co56, Fe52, 0.0); + + scratch = screened_rates(k_He4_Fe53_to_p_Co56_reaclib)*Y(He4)*state.rho; + jac.set(Co56, Fe53, scratch); + + jac.set(Co56, Fe54, 0.0); + + scratch = screened_rates(k_p_Fe55_to_Co56_reaclib)*Y(H1)*state.rho; + jac.set(Co56, Fe55, scratch); + + scratch = screened_rates(k_Fe56_to_Co56_weaktab) + screened_rates(k_p_Fe56_to_n_Co56_derived)*Y(H1)*state.rho; + jac.set(Co56, Fe56, scratch); + + scratch = screened_rates(k_n_Co55_to_Co56_reaclib)*Y(N)*state.rho; + jac.set(Co56, Co55, scratch); + + scratch = -screened_rates(k_Co56_to_Fe56_weaktab) - screened_rates(k_Co56_to_He4_Mn52_derived) - screened_rates(k_Co56_to_Ni56_weaktab) - screened_rates(k_Co56_to_n_Co55_derived) - screened_rates(k_Co56_to_p_Fe55_derived) - screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(He4)*state.rho - screened_rates(k_n_Co56_to_Co57_reaclib)*Y(N)*state.rho - screened_rates(k_n_Co56_to_p_Fe56_reaclib)*Y(N)*state.rho - screened_rates(k_p_Co56_to_He4_Fe53_derived)*Y(H1)*state.rho - screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(H1)*state.rho; + jac.set(Co56, Co56, scratch); + + scratch = screened_rates(k_Co57_to_n_Co56_derived); + jac.set(Co56, Co57, scratch); + + scratch = screened_rates(k_Ni56_to_Co56_weaktab) + screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(N)*state.rho; + jac.set(Co56, Ni56, scratch); + + scratch = screened_rates(k_Ni57_to_p_Co56_derived); + jac.set(Co56, Ni57, scratch); + + jac.set(Co56, Ni58, 0.0); + + scratch = screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(N)*state.rho; + jac.set(Co56, Cu59, scratch); + + jac.set(Co56, Zn60, 0.0); + + scratch = screened_rates(k_n_Co56_to_Co57_reaclib)*Y(Co56)*state.rho + screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*state.rho; + jac.set(Co57, N, scratch); + + scratch = -screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(Co57)*state.rho - screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(Co57)*state.rho - screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*state.rho + screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(Fe56)*state.rho; + jac.set(Co57, H1, scratch); + + scratch = screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(Fe54)*state.rho; + jac.set(Co57, He4, scratch); + + jac.set(Co57, C12, 0.0); + + jac.set(Co57, C13, 0.0); + + jac.set(Co57, C14, 0.0); + + jac.set(Co57, N13, 0.0); + + jac.set(Co57, N14, 0.0); + + jac.set(Co57, N15, 0.0); + + jac.set(Co57, O16, 0.0); + + jac.set(Co57, O17, 0.0); + + jac.set(Co57, O18, 0.0); + + jac.set(Co57, F18, 0.0); + + jac.set(Co57, F19, 0.0); + + jac.set(Co57, Ne20, 0.0); + + jac.set(Co57, Ne21, 0.0); + + jac.set(Co57, Ne22, 0.0); + + jac.set(Co57, Na22, 0.0); + + jac.set(Co57, Na23, 0.0); + + jac.set(Co57, Mg24, 0.0); + + jac.set(Co57, Mg25, 0.0); + + jac.set(Co57, Al26, 0.0); + + jac.set(Co57, Al27, 0.0); + + jac.set(Co57, Si28, 0.0); + + jac.set(Co57, Si29, 0.0); + + jac.set(Co57, P30, 0.0); + + jac.set(Co57, P31, 0.0); + + jac.set(Co57, S32, 0.0); + + jac.set(Co57, S33, 0.0); + + jac.set(Co57, Cl34, 0.0); + + jac.set(Co57, Cl35, 0.0); + + jac.set(Co57, Ar36, 0.0); + + jac.set(Co57, Ar37, 0.0); + + jac.set(Co57, K38, 0.0); + + jac.set(Co57, K39, 0.0); + + jac.set(Co57, Ca40, 0.0); + + jac.set(Co57, Ca41, 0.0); + + jac.set(Co57, Sc42, 0.0); + + jac.set(Co57, Sc43, 0.0); + + jac.set(Co57, Ti44, 0.0); + + jac.set(Co57, Ti45, 0.0); + + jac.set(Co57, V46, 0.0); + + jac.set(Co57, V47, 0.0); + + jac.set(Co57, Cr48, 0.0); + + jac.set(Co57, Cr49, 0.0); + + jac.set(Co57, Mn50, 0.0); + + jac.set(Co57, Mn51, 0.0); + + jac.set(Co57, Mn52, 0.0); + + jac.set(Co57, Fe52, 0.0); + + jac.set(Co57, Fe53, 0.0); + + scratch = screened_rates(k_He4_Fe54_to_p_Co57_derived)*Y(He4)*state.rho; + jac.set(Co57, Fe54, scratch); + + jac.set(Co57, Fe55, 0.0); + + scratch = screened_rates(k_p_Fe56_to_Co57_reaclib)*Y(H1)*state.rho; + jac.set(Co57, Fe56, scratch); + + jac.set(Co57, Co55, 0.0); + + scratch = screened_rates(k_n_Co56_to_Co57_reaclib)*Y(N)*state.rho; + jac.set(Co57, Co56, scratch); + + scratch = -screened_rates(k_Co57_to_Ni57_weaktab) - screened_rates(k_Co57_to_n_Co56_derived) - screened_rates(k_Co57_to_p_Fe56_derived) - screened_rates(k_p_Co57_to_He4_Fe54_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(H1)*state.rho; + jac.set(Co57, Co57, scratch); + + jac.set(Co57, Ni56, 0.0); + + scratch = screened_rates(k_Ni57_to_Co57_weaktab) + screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(N)*state.rho; + jac.set(Co57, Ni57, scratch); + + scratch = screened_rates(k_Ni58_to_p_Co57_derived); + jac.set(Co57, Ni58, scratch); + + jac.set(Co57, Cu59, 0.0); + + jac.set(Co57, Zn60, 0.0); + + scratch = -screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(Ni56)*state.rho - screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(Ni56)*state.rho - screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(Ni56)*state.rho; + jac.set(Ni56, N, scratch); + + scratch = screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(Co55)*state.rho + screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(Co56)*state.rho + screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*state.rho; + jac.set(Ni56, H1, scratch); + + scratch = screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(Fe52)*state.rho + screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(Ni56)*state.rho - screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(Ni56)*state.rho; + jac.set(Ni56, He4, scratch); + + jac.set(Ni56, C12, 0.0); + + jac.set(Ni56, C13, 0.0); + + jac.set(Ni56, C14, 0.0); + + jac.set(Ni56, N13, 0.0); + + jac.set(Ni56, N14, 0.0); + + jac.set(Ni56, N15, 0.0); + + jac.set(Ni56, O16, 0.0); + + jac.set(Ni56, O17, 0.0); + + jac.set(Ni56, O18, 0.0); + + jac.set(Ni56, F18, 0.0); + + jac.set(Ni56, F19, 0.0); + + jac.set(Ni56, Ne20, 0.0); + + jac.set(Ni56, Ne21, 0.0); + + jac.set(Ni56, Ne22, 0.0); + + jac.set(Ni56, Na22, 0.0); + + jac.set(Ni56, Na23, 0.0); + + jac.set(Ni56, Mg24, 0.0); + + jac.set(Ni56, Mg25, 0.0); + + jac.set(Ni56, Al26, 0.0); + + jac.set(Ni56, Al27, 0.0); + + jac.set(Ni56, Si28, 0.0); + + jac.set(Ni56, Si29, 0.0); + + jac.set(Ni56, P30, 0.0); + + jac.set(Ni56, P31, 0.0); + + jac.set(Ni56, S32, 0.0); + + jac.set(Ni56, S33, 0.0); + + jac.set(Ni56, Cl34, 0.0); + + jac.set(Ni56, Cl35, 0.0); + + jac.set(Ni56, Ar36, 0.0); + + jac.set(Ni56, Ar37, 0.0); + + jac.set(Ni56, K38, 0.0); + + jac.set(Ni56, K39, 0.0); + + jac.set(Ni56, Ca40, 0.0); + + jac.set(Ni56, Ca41, 0.0); + + jac.set(Ni56, Sc42, 0.0); + + jac.set(Ni56, Sc43, 0.0); + + jac.set(Ni56, Ti44, 0.0); + + jac.set(Ni56, Ti45, 0.0); + + jac.set(Ni56, V46, 0.0); + + jac.set(Ni56, V47, 0.0); + + jac.set(Ni56, Cr48, 0.0); + + jac.set(Ni56, Cr49, 0.0); + + jac.set(Ni56, Mn50, 0.0); + + jac.set(Ni56, Mn51, 0.0); + + jac.set(Ni56, Mn52, 0.0); + + scratch = screened_rates(k_He4_Fe52_to_Ni56_reaclib)*Y(He4)*state.rho; + jac.set(Ni56, Fe52, scratch); + + scratch = screened_rates(k_He4_Fe53_to_n_Ni56_derived)*Y(He4)*state.rho; + jac.set(Ni56, Fe53, scratch); + + jac.set(Ni56, Fe54, 0.0); + + jac.set(Ni56, Fe55, 0.0); + + jac.set(Ni56, Fe56, 0.0); + + scratch = screened_rates(k_p_Co55_to_Ni56_reaclib)*Y(H1)*state.rho; + jac.set(Ni56, Co55, scratch); + + scratch = screened_rates(k_Co56_to_Ni56_weaktab) + screened_rates(k_p_Co56_to_n_Ni56_derived)*Y(H1)*state.rho; + jac.set(Ni56, Co56, scratch); + + jac.set(Ni56, Co57, 0.0); + + scratch = -screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(He4)*state.rho - screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*state.rho - screened_rates(k_Ni56_to_Co56_weaktab) - screened_rates(k_Ni56_to_He4_Fe52_derived) - screened_rates(k_Ni56_to_p_Co55_derived) - screened_rates(k_n_Ni56_to_He4_Fe53_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni56_to_p_Co56_reaclib)*Y(N)*state.rho; + jac.set(Ni56, Ni56, scratch); + + scratch = screened_rates(k_Ni57_to_n_Ni56_derived); + jac.set(Ni56, Ni57, scratch); + + jac.set(Ni56, Ni58, 0.0); + + scratch = screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(H1)*state.rho; + jac.set(Ni56, Cu59, scratch); + + scratch = screened_rates(k_Zn60_to_He4_Ni56_derived); + jac.set(Ni56, Zn60, scratch); + + scratch = screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(Ni56)*state.rho - screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(Ni57)*state.rho - screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(Ni57)*state.rho - screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(Ni57)*state.rho + screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*state.rho; + jac.set(Ni57, N, scratch); + + scratch = screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(Co56)*state.rho + screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(Co57)*state.rho; + jac.set(Ni57, H1, scratch); + + scratch = screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(Fe53)*state.rho + screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(Ni57)*state.rho; + jac.set(Ni57, He4, scratch); + + jac.set(Ni57, C12, 0.0); + + jac.set(Ni57, C13, 0.0); + + jac.set(Ni57, C14, 0.0); + + jac.set(Ni57, N13, 0.0); + + jac.set(Ni57, N14, 0.0); + + jac.set(Ni57, N15, 0.0); + + jac.set(Ni57, O16, 0.0); + + jac.set(Ni57, O17, 0.0); + + jac.set(Ni57, O18, 0.0); + + jac.set(Ni57, F18, 0.0); + + jac.set(Ni57, F19, 0.0); + + jac.set(Ni57, Ne20, 0.0); + + jac.set(Ni57, Ne21, 0.0); + + jac.set(Ni57, Ne22, 0.0); + + jac.set(Ni57, Na22, 0.0); + + jac.set(Ni57, Na23, 0.0); + + jac.set(Ni57, Mg24, 0.0); + + jac.set(Ni57, Mg25, 0.0); + + jac.set(Ni57, Al26, 0.0); + + jac.set(Ni57, Al27, 0.0); + + jac.set(Ni57, Si28, 0.0); + + jac.set(Ni57, Si29, 0.0); + + jac.set(Ni57, P30, 0.0); + + jac.set(Ni57, P31, 0.0); + + jac.set(Ni57, S32, 0.0); + + jac.set(Ni57, S33, 0.0); + + jac.set(Ni57, Cl34, 0.0); + + jac.set(Ni57, Cl35, 0.0); + + jac.set(Ni57, Ar36, 0.0); + + jac.set(Ni57, Ar37, 0.0); + + jac.set(Ni57, K38, 0.0); + + jac.set(Ni57, K39, 0.0); + + jac.set(Ni57, Ca40, 0.0); + + jac.set(Ni57, Ca41, 0.0); + + jac.set(Ni57, Sc42, 0.0); + + jac.set(Ni57, Sc43, 0.0); + + jac.set(Ni57, Ti44, 0.0); + + jac.set(Ni57, Ti45, 0.0); + + jac.set(Ni57, V46, 0.0); + + jac.set(Ni57, V47, 0.0); + + jac.set(Ni57, Cr48, 0.0); + + jac.set(Ni57, Cr49, 0.0); + + jac.set(Ni57, Mn50, 0.0); + + jac.set(Ni57, Mn51, 0.0); + + jac.set(Ni57, Mn52, 0.0); + + jac.set(Ni57, Fe52, 0.0); + + scratch = screened_rates(k_He4_Fe53_to_Ni57_reaclib)*Y(He4)*state.rho; + jac.set(Ni57, Fe53, scratch); + + scratch = screened_rates(k_He4_Fe54_to_n_Ni57_derived)*Y(He4)*state.rho; + jac.set(Ni57, Fe54, scratch); + + jac.set(Ni57, Fe55, 0.0); + + jac.set(Ni57, Fe56, 0.0); + + jac.set(Ni57, Co55, 0.0); + + scratch = screened_rates(k_p_Co56_to_Ni57_reaclib)*Y(H1)*state.rho; + jac.set(Ni57, Co56, scratch); + + scratch = screened_rates(k_Co57_to_Ni57_weaktab) + screened_rates(k_p_Co57_to_n_Ni57_derived)*Y(H1)*state.rho; + jac.set(Ni57, Co57, scratch); + + scratch = screened_rates(k_n_Ni56_to_Ni57_reaclib)*Y(N)*state.rho; + jac.set(Ni57, Ni56, scratch); + + scratch = -screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*state.rho - screened_rates(k_Ni57_to_Co57_weaktab) - screened_rates(k_Ni57_to_He4_Fe53_derived) - screened_rates(k_Ni57_to_n_Ni56_derived) - screened_rates(k_Ni57_to_p_Co56_derived) - screened_rates(k_n_Ni57_to_He4_Fe54_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(N)*state.rho - screened_rates(k_n_Ni57_to_p_Co57_reaclib)*Y(N)*state.rho; + jac.set(Ni57, Ni57, scratch); + + scratch = screened_rates(k_Ni58_to_n_Ni57_derived); + jac.set(Ni57, Ni58, scratch); + + jac.set(Ni57, Cu59, 0.0); + + scratch = screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(N)*state.rho; + jac.set(Ni57, Zn60, scratch); + + scratch = screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(Ni57)*state.rho - screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(Ni58)*state.rho; + jac.set(Ni58, N, scratch); + + scratch = screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(Co57)*state.rho - screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(Ni58)*state.rho - screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(Ni58)*state.rho; + jac.set(Ni58, H1, scratch); + + scratch = screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(Co55)*state.rho + screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(Fe54)*state.rho + screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(Fe55)*state.rho; + jac.set(Ni58, He4, scratch); + + jac.set(Ni58, C12, 0.0); + + jac.set(Ni58, C13, 0.0); + + jac.set(Ni58, C14, 0.0); + + jac.set(Ni58, N13, 0.0); + + jac.set(Ni58, N14, 0.0); + + jac.set(Ni58, N15, 0.0); + + jac.set(Ni58, O16, 0.0); + + jac.set(Ni58, O17, 0.0); + + jac.set(Ni58, O18, 0.0); + + jac.set(Ni58, F18, 0.0); + + jac.set(Ni58, F19, 0.0); + + jac.set(Ni58, Ne20, 0.0); + + jac.set(Ni58, Ne21, 0.0); + + jac.set(Ni58, Ne22, 0.0); + + jac.set(Ni58, Na22, 0.0); + + jac.set(Ni58, Na23, 0.0); + + jac.set(Ni58, Mg24, 0.0); + + jac.set(Ni58, Mg25, 0.0); + + jac.set(Ni58, Al26, 0.0); + + jac.set(Ni58, Al27, 0.0); + + jac.set(Ni58, Si28, 0.0); + + jac.set(Ni58, Si29, 0.0); + + jac.set(Ni58, P30, 0.0); + + jac.set(Ni58, P31, 0.0); + + jac.set(Ni58, S32, 0.0); + + jac.set(Ni58, S33, 0.0); + + jac.set(Ni58, Cl34, 0.0); + + jac.set(Ni58, Cl35, 0.0); + + jac.set(Ni58, Ar36, 0.0); + + jac.set(Ni58, Ar37, 0.0); + + jac.set(Ni58, K38, 0.0); + + jac.set(Ni58, K39, 0.0); + + jac.set(Ni58, Ca40, 0.0); + + jac.set(Ni58, Ca41, 0.0); + + jac.set(Ni58, Sc42, 0.0); + + jac.set(Ni58, Sc43, 0.0); + + jac.set(Ni58, Ti44, 0.0); + + jac.set(Ni58, Ti45, 0.0); + + jac.set(Ni58, V46, 0.0); + + jac.set(Ni58, V47, 0.0); + + jac.set(Ni58, Cr48, 0.0); + + jac.set(Ni58, Cr49, 0.0); + + jac.set(Ni58, Mn50, 0.0); + + jac.set(Ni58, Mn51, 0.0); + + jac.set(Ni58, Mn52, 0.0); + + jac.set(Ni58, Fe52, 0.0); + + jac.set(Ni58, Fe53, 0.0); + + scratch = screened_rates(k_He4_Fe54_to_Ni58_reaclib)*Y(He4)*state.rho; + jac.set(Ni58, Fe54, scratch); + + scratch = screened_rates(k_He4_Fe55_to_n_Ni58_derived)*Y(He4)*state.rho; + jac.set(Ni58, Fe55, scratch); + + jac.set(Ni58, Fe56, 0.0); + + scratch = screened_rates(k_He4_Co55_to_p_Ni58_reaclib)*Y(He4)*state.rho; + jac.set(Ni58, Co55, scratch); + + jac.set(Ni58, Co56, 0.0); + + scratch = screened_rates(k_p_Co57_to_Ni58_reaclib)*Y(H1)*state.rho; + jac.set(Ni58, Co57, scratch); + + jac.set(Ni58, Ni56, 0.0); + + scratch = screened_rates(k_n_Ni57_to_Ni58_reaclib)*Y(N)*state.rho; + jac.set(Ni58, Ni57, scratch); + + scratch = -screened_rates(k_Ni58_to_He4_Fe54_derived) - screened_rates(k_Ni58_to_n_Ni57_derived) - screened_rates(k_Ni58_to_p_Co57_derived) - screened_rates(k_n_Ni58_to_He4_Fe55_reaclib)*Y(N)*state.rho - screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Ni58_to_He4_Co55_derived)*Y(H1)*state.rho; + jac.set(Ni58, Ni58, scratch); + + scratch = screened_rates(k_Cu59_to_p_Ni58_derived); + jac.set(Ni58, Cu59, scratch); + + jac.set(Ni58, Zn60, 0.0); + + scratch = -screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(Cu59)*state.rho; + jac.set(Cu59, N, scratch); + + scratch = -screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(Cu59)*state.rho - screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(Cu59)*state.rho + screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(Ni58)*state.rho; + jac.set(Cu59, H1, scratch); + + scratch = screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(Co55)*state.rho + screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(Co56)*state.rho + screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(Ni56)*state.rho; + jac.set(Cu59, He4, scratch); + + jac.set(Cu59, C12, 0.0); + + jac.set(Cu59, C13, 0.0); + + jac.set(Cu59, C14, 0.0); + + jac.set(Cu59, N13, 0.0); + + jac.set(Cu59, N14, 0.0); + + jac.set(Cu59, N15, 0.0); + + jac.set(Cu59, O16, 0.0); + + jac.set(Cu59, O17, 0.0); + + jac.set(Cu59, O18, 0.0); + + jac.set(Cu59, F18, 0.0); + + jac.set(Cu59, F19, 0.0); + + jac.set(Cu59, Ne20, 0.0); + + jac.set(Cu59, Ne21, 0.0); + + jac.set(Cu59, Ne22, 0.0); + + jac.set(Cu59, Na22, 0.0); + + jac.set(Cu59, Na23, 0.0); + + jac.set(Cu59, Mg24, 0.0); + + jac.set(Cu59, Mg25, 0.0); + + jac.set(Cu59, Al26, 0.0); + + jac.set(Cu59, Al27, 0.0); + + jac.set(Cu59, Si28, 0.0); + + jac.set(Cu59, Si29, 0.0); + + jac.set(Cu59, P30, 0.0); + + jac.set(Cu59, P31, 0.0); + + jac.set(Cu59, S32, 0.0); + + jac.set(Cu59, S33, 0.0); + + jac.set(Cu59, Cl34, 0.0); + + jac.set(Cu59, Cl35, 0.0); + + jac.set(Cu59, Ar36, 0.0); + + jac.set(Cu59, Ar37, 0.0); + + jac.set(Cu59, K38, 0.0); + + jac.set(Cu59, K39, 0.0); + + jac.set(Cu59, Ca40, 0.0); + + jac.set(Cu59, Ca41, 0.0); + + jac.set(Cu59, Sc42, 0.0); + + jac.set(Cu59, Sc43, 0.0); + + jac.set(Cu59, Ti44, 0.0); + + jac.set(Cu59, Ti45, 0.0); + + jac.set(Cu59, V46, 0.0); + + jac.set(Cu59, V47, 0.0); + + jac.set(Cu59, Cr48, 0.0); + + jac.set(Cu59, Cr49, 0.0); + + jac.set(Cu59, Mn50, 0.0); + + jac.set(Cu59, Mn51, 0.0); + + jac.set(Cu59, Mn52, 0.0); + + jac.set(Cu59, Fe52, 0.0); + + jac.set(Cu59, Fe53, 0.0); + + jac.set(Cu59, Fe54, 0.0); + + jac.set(Cu59, Fe55, 0.0); + + jac.set(Cu59, Fe56, 0.0); + + scratch = screened_rates(k_He4_Co55_to_Cu59_reaclib)*Y(He4)*state.rho; + jac.set(Cu59, Co55, scratch); + + scratch = screened_rates(k_He4_Co56_to_n_Cu59_derived)*Y(He4)*state.rho; + jac.set(Cu59, Co56, scratch); + + jac.set(Cu59, Co57, 0.0); + + scratch = screened_rates(k_He4_Ni56_to_p_Cu59_derived)*Y(He4)*state.rho; + jac.set(Cu59, Ni56, scratch); + + jac.set(Cu59, Ni57, 0.0); + + scratch = screened_rates(k_p_Ni58_to_Cu59_reaclib)*Y(H1)*state.rho; + jac.set(Cu59, Ni58, scratch); + + scratch = -screened_rates(k_Cu59_to_He4_Co55_derived) - screened_rates(k_Cu59_to_p_Ni58_derived) - screened_rates(k_n_Cu59_to_He4_Co56_reaclib)*Y(N)*state.rho - screened_rates(k_p_Cu59_to_He4_Ni56_reaclib)*Y(H1)*state.rho - screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(H1)*state.rho; + jac.set(Cu59, Cu59, scratch); + + scratch = screened_rates(k_Zn60_to_p_Cu59_derived); + jac.set(Cu59, Zn60, scratch); + + scratch = -screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(Zn60)*state.rho; + jac.set(Zn60, N, scratch); + + scratch = screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(Cu59)*state.rho; + jac.set(Zn60, H1, scratch); + + scratch = screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(Ni56)*state.rho + screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(Ni57)*state.rho; + jac.set(Zn60, He4, scratch); + + jac.set(Zn60, C12, 0.0); + + jac.set(Zn60, C13, 0.0); + + jac.set(Zn60, C14, 0.0); + + jac.set(Zn60, N13, 0.0); + + jac.set(Zn60, N14, 0.0); + + jac.set(Zn60, N15, 0.0); + + jac.set(Zn60, O16, 0.0); + + jac.set(Zn60, O17, 0.0); + + jac.set(Zn60, O18, 0.0); + + jac.set(Zn60, F18, 0.0); + + jac.set(Zn60, F19, 0.0); + + jac.set(Zn60, Ne20, 0.0); + + jac.set(Zn60, Ne21, 0.0); + + jac.set(Zn60, Ne22, 0.0); + + jac.set(Zn60, Na22, 0.0); + + jac.set(Zn60, Na23, 0.0); + + jac.set(Zn60, Mg24, 0.0); + + jac.set(Zn60, Mg25, 0.0); + + jac.set(Zn60, Al26, 0.0); + + jac.set(Zn60, Al27, 0.0); + + jac.set(Zn60, Si28, 0.0); + + jac.set(Zn60, Si29, 0.0); + + jac.set(Zn60, P30, 0.0); + + jac.set(Zn60, P31, 0.0); + + jac.set(Zn60, S32, 0.0); + + jac.set(Zn60, S33, 0.0); + + jac.set(Zn60, Cl34, 0.0); + + jac.set(Zn60, Cl35, 0.0); + + jac.set(Zn60, Ar36, 0.0); + + jac.set(Zn60, Ar37, 0.0); + + jac.set(Zn60, K38, 0.0); + + jac.set(Zn60, K39, 0.0); + + jac.set(Zn60, Ca40, 0.0); + + jac.set(Zn60, Ca41, 0.0); + + jac.set(Zn60, Sc42, 0.0); + + jac.set(Zn60, Sc43, 0.0); + + jac.set(Zn60, Ti44, 0.0); + + jac.set(Zn60, Ti45, 0.0); + + jac.set(Zn60, V46, 0.0); + + jac.set(Zn60, V47, 0.0); + + jac.set(Zn60, Cr48, 0.0); + + jac.set(Zn60, Cr49, 0.0); + + jac.set(Zn60, Mn50, 0.0); + + jac.set(Zn60, Mn51, 0.0); + + jac.set(Zn60, Mn52, 0.0); + + jac.set(Zn60, Fe52, 0.0); + + jac.set(Zn60, Fe53, 0.0); + + jac.set(Zn60, Fe54, 0.0); + + jac.set(Zn60, Fe55, 0.0); + + jac.set(Zn60, Fe56, 0.0); + + jac.set(Zn60, Co55, 0.0); + + jac.set(Zn60, Co56, 0.0); + + jac.set(Zn60, Co57, 0.0); + + scratch = screened_rates(k_He4_Ni56_to_Zn60_reaclib)*Y(He4)*state.rho; + jac.set(Zn60, Ni56, scratch); + + scratch = screened_rates(k_He4_Ni57_to_n_Zn60_derived)*Y(He4)*state.rho; + jac.set(Zn60, Ni57, scratch); + + jac.set(Zn60, Ni58, 0.0); + + scratch = screened_rates(k_p_Cu59_to_Zn60_reaclib)*Y(H1)*state.rho; + jac.set(Zn60, Cu59, scratch); + + scratch = -screened_rates(k_Zn60_to_He4_Ni56_derived) - screened_rates(k_Zn60_to_p_Cu59_derived) - screened_rates(k_n_Zn60_to_He4_Ni57_reaclib)*Y(N)*state.rho; + jac.set(Zn60, Zn60, scratch); + + +} + + + +template +AMREX_GPU_DEVICE AMREX_INLINE +void actual_jac(const burn_t& state, MatrixType& jac) +{ + + // Set molar abundances + amrex::Array1D Y; + for (int i = 1; i <= NumSpec; ++i) { + Y(i) = state.xn[i-1] * aion_inv[i-1]; + } + + + rate_derivs_t rate_eval; + + constexpr int do_T_derivatives = 1; + + evaluate_rates(state, Y, rate_eval); + + // Species Jacobian elements with respect to other species + + jac_nuc(state, jac, Y, rate_eval.screened_rates); + + // Energy generation rate Jacobian elements with respect to species + + for (int j = 1; j <= NumSpec; ++j) { + auto jac_slice_2 = [&](int i) -> amrex::Real { return jac.get(i, j); }; + amrex::Real tmp{}; + ener_gener_rate(jac_slice_2, tmp); + jac(net_ienuc,j) = tmp; + } + + // Account for the thermal neutrino losses + + amrex::Real dsneutdt{}; +#ifdef NEUTRINOS + amrex::Real sneut, dsneutdd, dsnuda, dsnudz; + constexpr int do_derivatives{1}; + neutrino_cooling(state.T, state.rho, state.abar, state.zbar, + sneut, dsneutdt, dsneutdd, dsnuda, dsnudz); + + for (int j = 1; j <= NumSpec; ++j) { + amrex::Real b1 = (-state.abar * state.abar * dsnuda + (zion[j-1] - state.zbar) * state.abar * dsnudz); + jac.add(net_ienuc, j, -b1); + } +#endif + + // Evaluate the Jacobian elements with respect to energy by + // calling the RHS using d(rate) / dT and then transform them + // to our energy integration variable. + + amrex::Array1D yderivs; + + rhs_nuc(state, yderivs, Y, rate_eval.dscreened_rates_dT); + + for (int k = 1; k <= NumSpec; k++) { + jac.set(k, net_ienuc, temperature_to_energy_jacobian(state, yderivs(k))); + } + + + // finally, d(de/dt)/de + + amrex::Real jac_e_T; + ener_gener_rate(yderivs, jac_e_T); + jac_e_T -= dsneutdt; + jac.set(net_ienuc, net_ienuc, temperature_to_energy_jacobian(state, jac_e_T)); + +} + + +AMREX_INLINE +void actual_rhs_init () { + + +} + + +#endif diff --git a/networks/he-burn/ase-big/approximate_rates.H b/networks/he-burn/ase-big/approximate_rates.H new file mode 100644 index 000000000..14d44a740 --- /dev/null +++ b/networks/he-burn/ase-big/approximate_rates.H @@ -0,0 +1,31 @@ +#ifndef APPROXIMATE_RATES_H +#define APPROXIMATE_RATES_H + +#include +#include + +#include +#include +#include + +using namespace Rates; +using namespace Species; + + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void +fill_approx_rates([[maybe_unused]] const tf_t& tfactors, + [[maybe_unused]] const amrex::Real rho, + [[maybe_unused]] const amrex::Array1D& Y, + [[maybe_unused]] T& rate_eval) +{ + + [[maybe_unused]] amrex::Real rate{}; + [[maybe_unused]] amrex::Real drate_dT{}; + + +} + +#endif diff --git a/networks/he-burn/ase-big/ase-big.png b/networks/he-burn/ase-big/ase-big.png new file mode 100644 index 000000000..21bed0949 Binary files /dev/null and b/networks/he-burn/ase-big/ase-big.png differ diff --git a/networks/he-burn/ase-big/ase_big.py b/networks/he-burn/ase-big/ase_big.py new file mode 100644 index 000000000..1996d7a95 --- /dev/null +++ b/networks/he-burn/ase-big/ase_big.py @@ -0,0 +1,107 @@ +# an approximate network for He/C burning with key rates +# to bypass the C12(a,g)O16 rate. +# This is fully-compatible with NSE. + +import pynucastro as pyna +from pynucastro.networks import AmrexAstroCxxNetwork + +DO_DERIVED_RATES = True + +def get_library(): + + reaclib_lib = pyna.ReacLibLibrary() + + all_reactants = ["p", "he4", + "c12", "c13", "c14", + "n13", "n14", "n15", + "o16", "o17", "o18", + "f18", "f19", + "ne20", "ne21", "ne22", + "na22", "na23", + "mg24", "mg25", + "al26", "al27", + "si28", "si29", + "p30", "p31", + "s32", "s33", + "cl34", "cl35", + "ar36", "ar37", + "k38", "k39", + "ca40", "ca41", + "sc42", "sc43", + "ti44", "ti45", + "v46", "v47", + "cr48", "cr49", + "mn50", "mn51", "mn52", + "co55", + "fe52", "ni56", + ] + + subch = reaclib_lib.linking_nuclei(all_reactants) + + + # iron group + iron_peak = ["n", "p", "he4", + "mn50", "mn51", "mn52", + "fe52", "fe53", "fe54", "fe55", "fe56", + "co55", "co56", "co57", + "ni56", "ni57", "ni58", "cu59", "zn60"] + subch += reaclib_lib.linking_nuclei(iron_peak) + weak_lib = pyna.TabularWeakLibrary(ordering=["ffn", "langanke", "oda"]) + iron_weak_lib = weak_lib.linking_nuclei(set(iron_peak + all_reactants)) + subch += iron_weak_lib + + if DO_DERIVED_RATES: + rates_to_derive = subch.backward().get_rates() + + # now for each of those derived rates, look to see if the pair exists + + for r in rates_to_derive: + fr = subch.get_rate_by_nuclei(r.products, r.reactants) + if fr: + print(f"modifying {r} from {fr}") + subch.remove_rate(r) + d = pyna.DerivedRate(fr, use_pf=True) + subch.add_rate(d) + + subch.eliminate_duplicates(rate_type_preference="tabular") + + return subch + + +def create_network(): + + subch = get_library() + + net = AmrexAstroCxxNetwork(libraries=[subch]) + + #net.make_nn_g_approx(intermediate_nuclei=["fe53", "fe55", "ni57"]) + #net.remove_nuclei(["fe53", "fe55", "ni57"]) + + return net + + +def doit(): + + net = create_network() + + net.summary() + + comp = pyna.Composition(net.get_nuclei()) + comp.set_all(0.1) + comp.set_nuc("he4", 0.95) + comp.normalize() + + rho = 1.e7 + T = 6.e9 + + net.plot(outfile="ase-big.png", + rotated=True, hide_xalpha=True, + size=(1500, 450), + node_size=600, node_font_size=9, + Z_range=(1, 31)) + + net.write_network() + + +if __name__ == "__main__": + doit() diff --git a/networks/he-burn/ase-big/derived_rates.H b/networks/he-burn/ase-big/derived_rates.H new file mode 100644 index 000000000..c625d25cd --- /dev/null +++ b/networks/he-burn/ase-big/derived_rates.H @@ -0,0 +1,11947 @@ +#ifndef DERIVED_RATES_H +#define DERIVED_RATES_H + +#include +#include +#include +#include +#include + +using namespace Rates; + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_N13_to_p_C12_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // N13 --> p + C12 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real N13_log_pf, dN13_log_pf_dT9; + + // setting N13 log(partition function) to 0.0 by default, independent of T + N13_log_pf = 0.0_rt; + dN13_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + C12_log_pf - N13_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dC12_log_pf_dT9 - dN13_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ls09n + ln_set_rate = 40.059128683693466 + -22.553277271250543 * tfactors.T9i + -13.692 * tfactors.T913i + -0.230881 * tfactors.T913 + + 4.44362 * tfactors.T9 + -3.15898 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 22.553277271250543 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.692 * tfactors.T943i + (1.0/3.0) * -0.230881 * tfactors.T923i + + 4.44362 + (5.0/3.0) * -3.15898 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from ls09r + ln_set_rate = 40.45372868369347 + -26.331767271250545 * tfactors.T9i + -5.10735 * tfactors.T913i + -2.24111 * tfactors.T913 + + 0.148883 * tfactors.T9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 26.331767271250545 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.10735 * tfactors.T943i + (1.0/3.0) * -2.24111 * tfactors.T923i + + 0.148883; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_N14_to_p_C13_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // N14 --> p + C13 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real C13_log_pf, dC13_log_pf_dT9; + + // setting C13 log(partition function) to 0.0 by default, independent of T + C13_log_pf = 0.0_rt; + dC13_log_pf_dT9 = 0.0_rt; + + amrex::Real N14_log_pf, dN14_log_pf_dT9; + + // setting N14 log(partition function) to 0.0 by default, independent of T + N14_log_pf = 0.0_rt; + dN14_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + C13_log_pf - N14_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dC13_log_pf_dT9 - dN14_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from nacrn + ln_set_rate = 41.72421240281699 + -87.62065170634826 * tfactors.T9i + -13.72 * tfactors.T913i + -0.450018 * tfactors.T913 + + 3.70823 * tfactors.T9 + -1.70545 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 87.62065170634826 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.72 * tfactors.T943i + (1.0/3.0) * -0.450018 * tfactors.T923i + + 3.70823 + (5.0/3.0) * -1.70545 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrr + ln_set_rate = 37.17241240281699 + -93.40212170634825 * tfactors.T9i + -0.196703 * tfactors.T913 + + 0.142126 * tfactors.T9 + -0.0238912 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 93.40212170634825 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.196703 * tfactors.T923i + + 0.142126 + (5.0/3.0) * -0.0238912 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrr + ln_set_rate = 38.39121240281698 + -101.17495170634825 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 101.17495170634825 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_N15_to_p_C14_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // N15 --> p + C14 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real N15_log_pf, dN15_log_pf_dT9; + + // setting N15 log(partition function) to 0.0 by default, independent of T + N15_log_pf = 0.0_rt; + dN15_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real C14_log_pf, dC14_log_pf_dT9; + + // setting C14 log(partition function) to 0.0 by default, independent of T + C14_log_pf = 0.0_rt; + dC14_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + C14_log_pf - N15_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dC14_log_pf_dT9 - dN15_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 40.031567482849354 + -119.97566957362164 * tfactors.T9i + -10.658 * tfactors.T913i + 1.73644 * tfactors.T913 + + -0.350498 * tfactors.T9 + 0.0279902 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 119.97566957362164 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -10.658 * tfactors.T943i + (1.0/3.0) * 1.73644 * tfactors.T923i + + -0.350498 + (5.0/3.0) * 0.0279902 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 43.04816748284936 + -118.45225957362165 * tfactors.T9i + -13.9619 * tfactors.T913i + -4.34315 * tfactors.T913 + + 6.64922 * tfactors.T9 + -3.22592 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 118.45225957362165 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.9619 * tfactors.T943i + (1.0/3.0) * -4.34315 * tfactors.T923i + + 6.64922 + (5.0/3.0) * -3.22592 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_O16_to_p_N15_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // O16 --> p + N15 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real N15_log_pf, dN15_log_pf_dT9; + + // setting N15 log(partition function) to 0.0 by default, independent of T + N15_log_pf = 0.0_rt; + dN15_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + N15_log_pf - O16_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dN15_log_pf_dT9 - dO16_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from li10r + ln_set_rate = 38.86679552635226 + -150.96226378057287 * tfactors.T9i + + 0.0459037 * tfactors.T9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 150.96226378057287 * tfactors.T9i * tfactors.T9i + + 0.0459037; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from li10r + ln_set_rate = 30.912955526352267 + -143.65591378057286 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 143.65591378057286 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from li10n + ln_set_rate = 44.33999552635227 + -140.73276378057287 * tfactors.T9i + -15.24 * tfactors.T913i + 0.334926 * tfactors.T913 + + 4.59088 * tfactors.T9 + -4.78468 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 140.73276378057287 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -15.24 * tfactors.T943i + (1.0/3.0) * 0.334926 * tfactors.T923i + + 4.59088 + (5.0/3.0) * -4.78468 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_O16_to_He4_C12_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // O16 --> He4 + C12 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + C12_log_pf - O16_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dC12_log_pf_dT9 - dO16_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from nac2 + ln_set_rate = 279.29694929711803 + -84.95157686791683 * tfactors.T9i + 103.411 * tfactors.T913i + -420.567 * tfactors.T913 + + 64.0874 * tfactors.T9 + -12.4624 * tfactors.T953 + 138.803 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 84.95157686791683 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 103.411 * tfactors.T943i + (1.0/3.0) * -420.567 * tfactors.T923i + + 64.0874 + (5.0/3.0) * -12.4624 * tfactors.T923 + 138.803 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nac2 + ln_set_rate = 94.31554929711803 + -84.50314686791683 * tfactors.T9i + 58.9128 * tfactors.T913i + -148.273 * tfactors.T913 + + 9.08324 * tfactors.T9 + -0.541041 * tfactors.T953 + 71.8554 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 84.50314686791683 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 58.9128 * tfactors.T943i + (1.0/3.0) * -148.273 * tfactors.T923i + + 9.08324 + (5.0/3.0) * -0.541041 * tfactors.T923 + 71.8554 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_O18_to_He4_C14_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // O18 --> He4 + C14 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real O18_log_pf, dO18_log_pf_dT9; + + // interpolating O18 partition function + get_partition_function_cached(O18, tfactors.T9, pf_cache, O18_log_pf, dO18_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real C14_log_pf, dC14_log_pf_dT9; + + // setting C14 log(partition function) to 0.0 by default, independent of T + C14_log_pf = 0.0_rt; + dC14_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = He4_log_pf + C14_log_pf - O18_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dC14_log_pf_dT9 - dO18_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 36.54830162906396 + -82.66688913950057 * tfactors.T9i + -3.83188 * tfactors.T913 + + 1.64358 * tfactors.T9 + -0.177785 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 82.66688913950057 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.83188 * tfactors.T923i + + 1.64358 + (5.0/3.0) * -0.177785 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 0.9124016290639609 + -74.33734913950056 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 74.33734913950056 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 43.20510162906396 + -72.26858913950056 * tfactors.T9i + -31.7222 * tfactors.T913i + 11.3923 * tfactors.T913 + + -9.92249 * tfactors.T9 + -2.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 72.26858913950056 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -31.7222 * tfactors.T943i + (1.0/3.0) * 11.3923 * tfactors.T923i + + -9.92249 + (5.0/3.0) * -2.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_F18_to_p_O17_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // F18 --> p + O17 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real F18_log_pf, dF18_log_pf_dT9; + + // interpolating F18 partition function + get_partition_function_cached(F18, tfactors.T9, pf_cache, F18_log_pf, dF18_log_pf_dT9); + + amrex::Real O17_log_pf, dO17_log_pf_dT9; + + // interpolating O17 partition function + get_partition_function_cached(O17, tfactors.T9, pf_cache, O17_log_pf, dO17_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + O17_log_pf - F18_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dO17_log_pf_dT9 - dF18_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 33.72287495567065 + -71.29605321275191 * tfactors.T9i + 2.31435 * tfactors.T913 + + -0.302835 * tfactors.T9 + 0.020133 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 71.29605321275191 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 2.31435 * tfactors.T923i + + -0.302835 + (5.0/3.0) * 0.020133 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 11.255394955670651 + -65.81406921275192 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 65.81406921275192 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 40.22529495567065 + -65.06777321275192 * tfactors.T9i + -16.4035 * tfactors.T913i + 4.31885 * tfactors.T913 + + -0.709921 * tfactors.T9 + -2.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 65.06777321275192 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -16.4035 * tfactors.T943i + (1.0/3.0) * 4.31885 * tfactors.T923i + + -0.709921 + (5.0/3.0) * -2.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_F18_to_He4_N14_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // F18 --> He4 + N14 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real F18_log_pf, dF18_log_pf_dT9; + + // interpolating F18 partition function + get_partition_function_cached(F18, tfactors.T9, pf_cache, F18_log_pf, dF18_log_pf_dT9); + + amrex::Real N14_log_pf, dN14_log_pf_dT9; + + // setting N14 log(partition function) to 0.0 by default, independent of T + N14_log_pf = 0.0_rt; + dN14_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = He4_log_pf + N14_log_pf - F18_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dN14_log_pf_dT9 - dF18_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 38.61662473666887 + -62.20224752987261 * tfactors.T9i + -5.6227 * tfactors.T913i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 62.20224752987261 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.6227 * tfactors.T943i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 24.91396273666887 + -56.396987529872604 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 56.396987529872604 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 46.25102473666887 + -51.236647529872606 * tfactors.T9i + -36.2504 * tfactors.T913i + + -5.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 51.236647529872606 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.2504 * tfactors.T943i + + (5.0/3.0) * -5.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_F19_to_p_O18_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // F19 --> p + O18 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real O18_log_pf, dO18_log_pf_dT9; + + // interpolating O18 partition function + get_partition_function_cached(O18, tfactors.T9, pf_cache, O18_log_pf, dO18_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real F19_log_pf, dF19_log_pf_dT9; + + // interpolating F19 partition function + get_partition_function_cached(F19, tfactors.T9, pf_cache, F19_log_pf, dF19_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + O18_log_pf - F19_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dO18_log_pf_dT9 - dF19_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10n + ln_set_rate = 42.868088644181995 + -92.7618744782197 * tfactors.T9i + -16.7246 * tfactors.T913i + + -3.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 92.7618744782197 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -16.7246 * tfactors.T943i + + (5.0/3.0) * -3.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 30.219848644181997 + -99.4871744782197 * tfactors.T9i + 3.99059 * tfactors.T913 + + -0.593127 * tfactors.T9 + 0.0877534 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 99.4871744782197 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 3.99059 * tfactors.T923i + + -0.593127 + (5.0/3.0) * 0.0877534 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 28.027568644181997 + -94.41868447821969 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 94.41868447821969 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -12.056811355818002 + -93.0066174782197 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 93.0066174782197 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_F19_to_He4_N15_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // F19 --> He4 + N15 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real N15_log_pf, dN15_log_pf_dT9; + + // setting N15 log(partition function) to 0.0 by default, independent of T + N15_log_pf = 0.0_rt; + dN15_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real F19_log_pf, dF19_log_pf_dT9; + + // interpolating F19 partition function + get_partition_function_cached(F19, tfactors.T9, pf_cache, F19_log_pf, dF19_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + N15_log_pf - F19_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dN15_log_pf_dT9 - dF19_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -4.0595772096034 + -50.77806404408662 * tfactors.T9i + 35.4292 * tfactors.T913 + + -5.5767 * tfactors.T9 + 0.441293 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 50.77806404408662 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 35.4292 * tfactors.T923i + + -5.5767 + (5.0/3.0) * 0.441293 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 28.273522790396598 + -53.56282404408662 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 53.56282404408662 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 15.3204027903966 + -50.75615404408662 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 50.75615404408662 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 50.130922790396596 + -46.57820404408662 * tfactors.T9i + -36.2324 * tfactors.T913i + + -2.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 46.57820404408662 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.2324 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ne20_to_p_F19_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne20 --> p + F19 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real F19_log_pf, dF19_log_pf_dT9; + + // interpolating F19 partition function + get_partition_function_cached(F19, tfactors.T9, pf_cache, F19_log_pf, dF19_log_pf_dT9); + + amrex::Real Ne20_log_pf, dNe20_log_pf_dT9; + + // interpolating Ne20 partition function + get_partition_function_cached(Ne20, tfactors.T9, pf_cache, Ne20_log_pf, dNe20_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + F19_log_pf - Ne20_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dF19_log_pf_dT9 - dNe20_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from nacrr + ln_set_rate = 18.711255537457795 + -156.78628300750532 * tfactors.T9i + 31.6442 * tfactors.T913i + -58.6563 * tfactors.T913 + + 67.7365 * tfactors.T9 + -22.9721 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 156.78628300750532 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 31.6442 * tfactors.T943i + (1.0/3.0) * -58.6563 * tfactors.T923i + + 67.7365 + (5.0/3.0) * -22.9721 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrr + ln_set_rate = 36.72378553745779 + -150.75597300750533 * tfactors.T9i + -11.3832 * tfactors.T913i + 5.47872 * tfactors.T913 + + -1.07203 * tfactors.T9 + 0.11196 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 150.75597300750533 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -11.3832 * tfactors.T943i + (1.0/3.0) * 5.47872 * tfactors.T923i + + -1.07203 + (5.0/3.0) * 0.11196 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrn + ln_set_rate = 42.62288553745779 + -149.04214300750533 * tfactors.T9i + -18.116 * tfactors.T913i + -1.4622 * tfactors.T913 + + 6.95113 * tfactors.T9 + -2.90366 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 149.04214300750533 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -18.116 * tfactors.T943i + (1.0/3.0) * -1.4622 * tfactors.T923i + + 6.95113 + (5.0/3.0) * -2.90366 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne20 --> He4 + O16 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real Ne20_log_pf, dNe20_log_pf_dT9; + + // interpolating Ne20 partition function + get_partition_function_cached(Ne20, tfactors.T9, pf_cache, Ne20_log_pf, dNe20_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + O16_log_pf - Ne20_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dO16_log_pf_dT9 - dNe20_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from co10r + ln_set_rate = 28.644822801502126 + -65.24608327101186 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 65.24608327101186 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from co10n + ln_set_rate = 48.662112801502126 + -54.887583271011856 * tfactors.T9i + -39.7262 * tfactors.T913i + -0.210799 * tfactors.T913 + + 0.442879 * tfactors.T9 + -0.0797753 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 54.887583271011856 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.7262 * tfactors.T943i + (1.0/3.0) * -0.210799 * tfactors.T923i + + 0.442879 + (5.0/3.0) * -0.0797753 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from co10r + ln_set_rate = 34.267592801502126 + -67.65188327101185 * tfactors.T9i + -3.65925 * tfactors.T913 + + 0.714224 * tfactors.T9 + -0.00107508 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 67.65188327101185 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.65925 * tfactors.T923i + + 0.714224 + (5.0/3.0) * -0.00107508 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ne21_to_He4_O17_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne21 --> He4 + O17 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ne21_log_pf, dNe21_log_pf_dT9; + + // interpolating Ne21 partition function + get_partition_function_cached(Ne21, tfactors.T9, pf_cache, Ne21_log_pf, dNe21_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real O17_log_pf, dO17_log_pf_dT9; + + // interpolating O17 partition function + get_partition_function_cached(O17, tfactors.T9, pf_cache, O17_log_pf, dO17_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + O17_log_pf - Ne21_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dO17_log_pf_dT9 - dNe21_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from be13r + ln_set_rate = 0.09298411543850094 + -90.7784662204353 * tfactors.T9i + 123.363 * tfactors.T913i + -87.4351 * tfactors.T913 + + -3.40974e-06 * tfactors.T9 + -57.0469 * tfactors.T953 + 83.7218 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 90.7784662204353 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 123.363 * tfactors.T943i + (1.0/3.0) * -87.4351 * tfactors.T923i + + -3.40974e-06 + (5.0/3.0) * -57.0469 * tfactors.T923 + 83.7218 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from be13r + ln_set_rate = -91.95121588456149 + -98.9451062204353 * tfactors.T9i + 3.31162e-08 * tfactors.T913i + 130.258 * tfactors.T913 + + -7.92551e-05 * tfactors.T9 + -4.13772 * tfactors.T953 + -41.2753 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 98.9451062204353 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 3.31162e-08 * tfactors.T943i + (1.0/3.0) * 130.258 * tfactors.T923i + + -7.92551e-05 + (5.0/3.0) * -4.13772 * tfactors.T923 + -41.2753 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from be13r + ln_set_rate = 27.322784115438502 + -91.26872622043531 * tfactors.T9i + 2.87641 * tfactors.T913i + -3.54489 * tfactors.T913 + + -2.11222e-08 * tfactors.T9 + -3.90649e-09 * tfactors.T953 + 6.25778 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 91.26872622043531 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 2.87641 * tfactors.T943i + (1.0/3.0) * -3.54489 * tfactors.T923i + + -2.11222e-08 + (5.0/3.0) * -3.90649e-09 * tfactors.T923 + 6.25778 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ne22_to_He4_O18_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne22 --> He4 + O18 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real O18_log_pf, dO18_log_pf_dT9; + + // interpolating O18 partition function + get_partition_function_cached(O18, tfactors.T9, pf_cache, O18_log_pf, dO18_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ne22_log_pf, dNe22_log_pf_dT9; + + // interpolating Ne22 partition function + get_partition_function_cached(Ne22, tfactors.T9, pf_cache, Ne22_log_pf, dNe22_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + O18_log_pf - Ne22_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dO18_log_pf_dT9 - dNe22_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -7.119065921580848 + -114.18179645973349 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 114.18179645973349 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -56.510065921580846 + -112.85484845973349 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 112.85484845973349 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 39.76833407841915 + -143.2255364597335 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 143.2255364597335 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 106.99883407841915 + -113.76407645973349 * tfactors.T9i + -44.3823 * tfactors.T913i + -46.6617 * tfactors.T913 + + 7.88059 * tfactors.T9 + -0.590829 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 113.76407645973349 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -44.3823 * tfactors.T943i + (1.0/3.0) * -46.6617 * tfactors.T923i + + 7.88059 + (5.0/3.0) * -0.590829 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Na22 --> p + Ne21 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ne21_log_pf, dNe21_log_pf_dT9; + + // interpolating Ne21 partition function + get_partition_function_cached(Ne21, tfactors.T9, pf_cache, Ne21_log_pf, dNe21_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Na22_log_pf, dNa22_log_pf_dT9; + + // interpolating Na22 partition function + get_partition_function_cached(Na22, tfactors.T9, pf_cache, Na22_log_pf, dNa22_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Ne21_log_pf - Na22_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dNe21_log_pf_dT9 - dNa22_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10n + ln_set_rate = 42.165346980750385 + -78.19798607071328 * tfactors.T9i + -19.2096 * tfactors.T913i + + -1.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 78.19798607071328 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -19.2096 * tfactors.T943i + + (5.0/3.0) * -1.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -16.390453019249613 + -82.41183607071328 * tfactors.T9i + 21.1176 * tfactors.T913i + 34.0411 * tfactors.T913 + + -4.45593 * tfactors.T9 + 0.328613 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 82.41183607071328 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.1176 * tfactors.T943i + (1.0/3.0) * 34.0411 * tfactors.T923i + + -4.45593 + (5.0/3.0) * 0.328613 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 24.852786980750384 + -79.59755607071328 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 79.59755607071328 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -24.559653019249616 + -78.39416607071328 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 78.39416607071328 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Na22 --> He4 + F18 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real F18_log_pf, dF18_log_pf_dT9; + + // interpolating F18 partition function + get_partition_function_cached(F18, tfactors.T9, pf_cache, F18_log_pf, dF18_log_pf_dT9); + + amrex::Real Na22_log_pf, dNa22_log_pf_dT9; + + // interpolating Na22 partition function + get_partition_function_cached(Na22, tfactors.T9, pf_cache, Na22_log_pf, dNa22_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + F18_log_pf - Na22_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dF18_log_pf_dT9 - dNa22_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from rpsmr + ln_set_rate = 59.32473614051823 + -100.22898907841348 * tfactors.T9i + 18.8956 * tfactors.T913i + -65.6134 * tfactors.T913 + + 1.71114 * tfactors.T9 + -0.0260999 * tfactors.T953 + 39.3396 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 100.22898907841348 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 18.8956 * tfactors.T943i + (1.0/3.0) * -65.6134 * tfactors.T923i + + 1.71114 + (5.0/3.0) * -0.0260999 * tfactors.T923 + 39.3396 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Na23_to_p_Ne22_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Na23 --> p + Ne22 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Na23_log_pf, dNa23_log_pf_dT9; + + // interpolating Na23 partition function + get_partition_function_cached(Na23, tfactors.T9, pf_cache, Na23_log_pf, dNa23_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ne22_log_pf, dNe22_log_pf_dT9; + + // interpolating Ne22 partition function + get_partition_function_cached(Ne22, tfactors.T9, pf_cache, Ne22_log_pf, dNe22_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Ne22_log_pf - Na23_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dNe22_log_pf_dT9 - dNa23_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ke17r + ln_set_rate = 21.673073381706992 + -103.77146219384292 * tfactors.T9i + + 1.189235 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 103.77146219384292 * tfactors.T9i * tfactors.T9i + + 1.189235 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from ke17r + ln_set_rate = 0.8379043817069913 + -102.46235419384291 * tfactors.T9i + + 0.009810000000000096 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 102.46235419384291 * tfactors.T9i * tfactors.T9i + + 0.009810000000000096 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from ke17r + ln_set_rate = 18.18205438170699 + -102.85114819384292 * tfactors.T9i + + 4.735580000000001 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 102.85114819384292 * tfactors.T9i * tfactors.T9i + + 4.735580000000001 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from ke17r + ln_set_rate = 36.30970438170699 + -110.77516219384292 * tfactors.T9i + + 0.732533 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 110.77516219384292 * tfactors.T9i * tfactors.T9i + + 0.732533 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from ke17r + ln_set_rate = 33.91320438170699 + -106.65075219384292 * tfactors.T9i + + 1.656226 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 106.65075219384292 * tfactors.T9i * tfactors.T9i + + 1.656226 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from ke17r + ln_set_rate = 18.266434381706993 + -104.66929219384292 * tfactors.T9i + + -2.79964 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 104.66929219384292 * tfactors.T9i * tfactors.T9i + + -2.79964 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Na23_to_He4_F19_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Na23 --> He4 + F19 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Na23_log_pf, dNa23_log_pf_dT9; + + // interpolating Na23 partition function + get_partition_function_cached(Na23, tfactors.T9, pf_cache, Na23_log_pf, dNa23_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real F19_log_pf, dF19_log_pf_dT9; + + // interpolating F19 partition function + get_partition_function_cached(F19, tfactors.T9, pf_cache, F19_log_pf, dF19_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + F19_log_pf - Na23_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dF19_log_pf_dT9 - dNa23_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from rpsmr + ln_set_rate = 76.90044981594414 + -123.58233417534949 * tfactors.T9i + 39.7219 * tfactors.T913i + -100.401 * tfactors.T913 + + 3.15808 * tfactors.T9 + -0.0629822 * tfactors.T953 + 55.9823 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 123.58233417534949 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 39.7219 * tfactors.T943i + (1.0/3.0) * -100.401 * tfactors.T923i + + 3.15808 + (5.0/3.0) * -0.0629822 * tfactors.T923 + 55.9823 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mg24 --> p + Na23 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Na23_log_pf, dNa23_log_pf_dT9; + + // interpolating Na23 partition function + get_partition_function_cached(Na23, tfactors.T9, pf_cache, Na23_log_pf, dNa23_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Mg24_log_pf, dMg24_log_pf_dT9; + + // interpolating Mg24 partition function + get_partition_function_cached(Mg24, tfactors.T9, pf_cache, Mg24_log_pf, dMg24_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Na23_log_pf - Mg24_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dNa23_log_pf_dT9 - dMg24_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 34.107544561463015 + -138.96838756220697 * tfactors.T9i + -0.360588 * tfactors.T913 + + 1.4187 * tfactors.T9 + -0.184061 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 138.96838756220697 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.360588 * tfactors.T923i + + 1.4187 + (5.0/3.0) * -0.184061 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 20.02229456146302 + -137.30028756220696 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 137.30028756220696 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 43.95564456146302 + -135.68809756220696 * tfactors.T9i + -20.6428 * tfactors.T913i + 1.52954 * tfactors.T913 + + 2.7487 * tfactors.T9 + -1.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 135.68809756220696 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -20.6428 * tfactors.T943i + (1.0/3.0) * 1.52954 * tfactors.T923i + + 2.7487 + (5.0/3.0) * -1.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mg24 --> He4 + Ne20 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mg24_log_pf, dMg24_log_pf_dT9; + + // interpolating Mg24 partition function + get_partition_function_cached(Mg24, tfactors.T9, pf_cache, Mg24_log_pf, dMg24_log_pf_dT9); + + amrex::Real Ne20_log_pf, dNe20_log_pf_dT9; + + // interpolating Ne20 partition function + get_partition_function_cached(Ne20, tfactors.T9, pf_cache, Ne20_log_pf, dNe20_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ne20_log_pf - Mg24_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dNe20_log_pf_dT9 - dMg24_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 16.022538839949377 + -120.89510873006793 * tfactors.T9i + 16.9229 * tfactors.T913 + + -2.57325 * tfactors.T9 + 0.208997 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 120.89510873006793 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 16.9229 * tfactors.T923i + + -2.57325 + (5.0/3.0) * 0.208997 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 26.803878839949377 + -117.33446873006793 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 117.33446873006793 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -13.884691160050625 + -110.62025873006793 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 110.62025873006793 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 49.32660883994937 + -108.11420873006793 * tfactors.T9i + -46.2525 * tfactors.T913i + 5.58901 * tfactors.T913 + + 7.61843 * tfactors.T9 + -3.683 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 108.11420873006793 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -46.2525 * tfactors.T943i + (1.0/3.0) * 5.58901 * tfactors.T923i + + 7.61843 + (5.0/3.0) * -3.683 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mg25_to_He4_Ne21_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mg25 --> He4 + Ne21 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ne21_log_pf, dNe21_log_pf_dT9; + + // interpolating Ne21 partition function + get_partition_function_cached(Ne21, tfactors.T9, pf_cache, Ne21_log_pf, dNe21_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mg25_log_pf, dMg25_log_pf_dT9; + + // interpolating Mg25 partition function + get_partition_function_cached(Mg25, tfactors.T9, pf_cache, Mg25_log_pf, dMg25_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ne21_log_pf - Mg25_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dNe21_log_pf_dT9 - dMg25_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88r + ln_set_rate = 50.67026655911652 + -136.77028986154426 * tfactors.T9i + -29.4583 * tfactors.T913 + + 14.6328 * tfactors.T9 + -3.47392 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 136.77028986154426 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -29.4583 * tfactors.T923i + + 14.6328 + (5.0/3.0) * -3.47392 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from cf88n + ln_set_rate = 61.12006655911652 + -114.72128986154426 * tfactors.T9i + -46.89 * tfactors.T913i + -0.72642 * tfactors.T913 + + -0.76406 * tfactors.T9 + 0.0797483 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 114.72128986154426 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -46.89 * tfactors.T943i + (1.0/3.0) * -0.72642 * tfactors.T923i + + -0.76406 + (5.0/3.0) * 0.0797483 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Al26_to_p_Mg25_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Al26 --> p + Mg25 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Al26_log_pf, dAl26_log_pf_dT9; + + // interpolating Al26 partition function + get_partition_function_cached(Al26, tfactors.T9, pf_cache, Al26_log_pf, dAl26_log_pf_dT9); + + amrex::Real Mg25_log_pf, dMg25_log_pf_dT9; + + // interpolating Mg25 partition function + get_partition_function_cached(Mg25, tfactors.T9, pf_cache, Mg25_log_pf, dMg25_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Mg25_log_pf - Al26_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dMg25_log_pf_dT9 - dAl26_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 27.27838039741493 + -73.90176311269589 * tfactors.T9i + -88.9297 * tfactors.T913 + + 302.948 * tfactors.T9 + -346.461 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 73.90176311269589 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -88.9297 * tfactors.T923i + + 302.948 + (5.0/3.0) * -346.461 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -14.13617960258507 + -73.61129911269589 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 73.61129911269589 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 25.28790039741493 + -76.40546311269588 * tfactors.T9i + 8.46334 * tfactors.T913 + + -0.907024 * tfactors.T9 + 0.0642981 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 76.40546311269588 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.46334 * tfactors.T923i + + -0.907024 + (5.0/3.0) * 0.0642981 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Al26_to_He4_Na22_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Al26 --> He4 + Na22 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Al26_log_pf, dAl26_log_pf_dT9; + + // interpolating Al26 partition function + get_partition_function_cached(Al26, tfactors.T9, pf_cache, Al26_log_pf, dAl26_log_pf_dT9); + + amrex::Real Na22_log_pf, dNa22_log_pf_dT9; + + // interpolating Na22 partition function + get_partition_function_cached(Na22, tfactors.T9, pf_cache, Na22_log_pf, dNa22_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Na22_log_pf - Al26_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dNa22_log_pf_dT9 - dAl26_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 60.771439975781064 + -109.70523690351963 * tfactors.T9i + -50.0924 * tfactors.T913i + -0.390826 * tfactors.T913 + + -0.99531 * tfactors.T9 + 0.101354 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 109.70523690351963 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -50.0924 * tfactors.T943i + (1.0/3.0) * -0.390826 * tfactors.T923i + + -0.99531 + (5.0/3.0) * 0.101354 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Al27_to_He4_Na23_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Al27 --> He4 + Na23 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Na23_log_pf, dNa23_log_pf_dT9; + + // interpolating Na23 partition function + get_partition_function_cached(Na23, tfactors.T9, pf_cache, Na23_log_pf, dNa23_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Al27_log_pf, dAl27_log_pf_dT9; + + // interpolating Al27 partition function + get_partition_function_cached(Al27, tfactors.T9, pf_cache, Al27_log_pf, dAl27_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Na23_log_pf - Al27_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dNa23_log_pf_dT9 - dAl27_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 69.2206963145215 + -117.11189602392653 * tfactors.T9i + -50.2042 * tfactors.T913i + -1.64239 * tfactors.T913 + + -1.59995 * tfactors.T9 + 0.184933 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 117.11189602392653 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -50.2042 * tfactors.T943i + (1.0/3.0) * -1.64239 * tfactors.T923i + + -1.59995 + (5.0/3.0) * 0.184933 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Si28 --> p + Al27 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Al27_log_pf, dAl27_log_pf_dT9; + + // interpolating Al27 partition function + get_partition_function_cached(Al27, tfactors.T9, pf_cache, Al27_log_pf, dAl27_log_pf_dT9); + + amrex::Real Si28_log_pf, dSi28_log_pf_dT9; + + // interpolating Si28 partition function + get_partition_function_cached(Si28, tfactors.T9, pf_cache, Si28_log_pf, dSi28_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Al27_log_pf - Si28_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dAl27_log_pf_dT9 - dSi28_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 11.796402252999236 + -136.3412367256539 * tfactors.T9i + 23.8634 * tfactors.T913 + + -3.70135 * tfactors.T9 + 0.28964 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 136.3412367256539 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 23.8634 * tfactors.T923i + + -3.70135 + (5.0/3.0) * 0.28964 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 111.48620225299923 + -134.8245897256539 * tfactors.T9i + -26.8327 * tfactors.T913i + -116.137 * tfactors.T913 + + 0.00950567 * tfactors.T9 + 0.00999755 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 134.8245897256539 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.8327 * tfactors.T943i + (1.0/3.0) * -116.137 * tfactors.T923i + + 0.00950567 + (5.0/3.0) * 0.00999755 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 46.569302252999236 + -134.4372767256539 * tfactors.T9i + -23.2205 * tfactors.T913i + + -2.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 134.4372767256539 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.2205 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Si28 --> He4 + Mg24 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mg24_log_pf, dMg24_log_pf_dT9; + + // interpolating Mg24 partition function + get_partition_function_cached(Mg24, tfactors.T9, pf_cache, Mg24_log_pf, dMg24_log_pf_dT9); + + amrex::Real Si28_log_pf, dSi28_log_pf_dT9; + + // interpolating Si28 partition function + get_partition_function_cached(Si28, tfactors.T9, pf_cache, Si28_log_pf, dSi28_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Mg24_log_pf - Si28_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dMg24_log_pf_dT9 - dSi28_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from st08r + ln_set_rate = 32.902724006057724 + -131.4900751873663 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 131.4900751873663 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from st08r + ln_set_rate = -25.68644599394228 + -128.6942751873663 * tfactors.T9i + 21.3721 * tfactors.T913i + 37.7649 * tfactors.T913 + + -4.10635 * tfactors.T9 + 0.249618 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 128.6942751873663 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.3721 * tfactors.T943i + (1.0/3.0) * 37.7649 * tfactors.T923i + + -4.10635 + (5.0/3.0) * 0.249618 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Si29_to_He4_Mg25_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Si29 --> He4 + Mg25 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Si29_log_pf, dSi29_log_pf_dT9; + + // interpolating Si29 partition function + get_partition_function_cached(Si29, tfactors.T9, pf_cache, Si29_log_pf, dSi29_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mg25_log_pf, dMg25_log_pf_dT9; + + // interpolating Mg25 partition function + get_partition_function_cached(Mg25, tfactors.T9, pf_cache, Mg25_log_pf, dMg25_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Mg25_log_pf - Si29_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dMg25_log_pf_dT9 - dSi29_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88n + ln_set_rate = 66.34177040898071 + -129.1259956125848 * tfactors.T9i + -53.41 * tfactors.T913i + -1.83266 * tfactors.T913 + + -0.573073 * tfactors.T9 + 0.0462678 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 129.1259956125848 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -53.41 * tfactors.T943i + (1.0/3.0) * -1.83266 * tfactors.T923i + + -0.573073 + (5.0/3.0) * 0.0462678 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_P30_to_p_Si29_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // P30 --> p + Si29 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Si29_log_pf, dSi29_log_pf_dT9; + + // interpolating Si29 partition function + get_partition_function_cached(Si29, tfactors.T9, pf_cache, Si29_log_pf, dSi29_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real P30_log_pf, dP30_log_pf_dT9; + + // interpolating P30 partition function + get_partition_function_cached(P30, tfactors.T9, pf_cache, P30_log_pf, dP30_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Si29_log_pf - P30_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dSi29_log_pf_dT9 - dP30_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 22.020796544549516 + -68.26366270095757 * tfactors.T9i + 14.0921 * tfactors.T913 + + -3.92096 * tfactors.T9 + 0.447706 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 68.26366270095757 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 14.0921 * tfactors.T923i + + -3.92096 + (5.0/3.0) * 0.447706 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 9.798606544549516 + -66.17463270095756 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 66.17463270095756 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 39.78690654454952 + -64.92437270095756 * tfactors.T9i + -23.9101 * tfactors.T913i + 10.7796 * tfactors.T913 + + -3.04181 * tfactors.T9 + 0.274565 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 64.92437270095756 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.9101 * tfactors.T943i + (1.0/3.0) * 10.7796 * tfactors.T923i + + -3.04181 + (5.0/3.0) * 0.274565 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_P30_to_He4_Al26_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // P30 --> He4 + Al26 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Al26_log_pf, dAl26_log_pf_dT9; + + // interpolating Al26 partition function + get_partition_function_cached(Al26, tfactors.T9, pf_cache, Al26_log_pf, dAl26_log_pf_dT9); + + amrex::Real P30_log_pf, dP30_log_pf_dT9; + + // interpolating P30 partition function + get_partition_function_cached(P30, tfactors.T9, pf_cache, P30_log_pf, dP30_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Al26_log_pf - P30_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dAl26_log_pf_dT9 - dP30_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 69.1566565561153 + -120.86843520086329 * tfactors.T9i + -56.4422 * tfactors.T913i + -2.44848 * tfactors.T913 + + -1.17578 * tfactors.T9 + 0.150757 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 120.86843520086329 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -56.4422 * tfactors.T943i + (1.0/3.0) * -2.44848 * tfactors.T923i + + -1.17578 + (5.0/3.0) * 0.150757 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_P31_to_He4_Al27_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // P31 --> He4 + Al27 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Al27_log_pf, dAl27_log_pf_dT9; + + // interpolating Al27 partition function + get_partition_function_cached(Al27, tfactors.T9, pf_cache, Al27_log_pf, dAl27_log_pf_dT9); + + amrex::Real P31_log_pf, dP31_log_pf_dT9; + + // interpolating P31 partition function + get_partition_function_cached(P31, tfactors.T9, pf_cache, P31_log_pf, dP31_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Al27_log_pf - P31_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dAl27_log_pf_dT9 - dP31_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 73.21877134266595 + -112.19944704325766 * tfactors.T9i + -56.5351 * tfactors.T913i + -0.896208 * tfactors.T913 + + -1.72024 * tfactors.T9 + 0.185409 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 112.19944704325766 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -56.5351 * tfactors.T943i + (1.0/3.0) * -0.896208 * tfactors.T923i + + -1.72024 + (5.0/3.0) * 0.185409 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_S32_to_p_P31_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // S32 --> p + P31 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real S32_log_pf, dS32_log_pf_dT9; + + // interpolating S32 partition function + get_partition_function_cached(S32, tfactors.T9, pf_cache, S32_log_pf, dS32_log_pf_dT9); + + amrex::Real P31_log_pf, dP31_log_pf_dT9; + + // interpolating P31 partition function + get_partition_function_cached(P31, tfactors.T9, pf_cache, P31_log_pf, dP31_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + P31_log_pf - S32_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dP31_log_pf_dT9 - dS32_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = 25.192389422303183 + -106.63906812813134 * tfactors.T9i + 8.09341 * tfactors.T913 + + -0.615971 * tfactors.T9 + 0.031159 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 106.63906812813134 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.09341 * tfactors.T923i + + -0.615971 + (5.0/3.0) * 0.031159 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 21.702443422303183 + -105.12160812813134 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 105.12160812813134 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 43.630433422303184 + -102.86202812813134 * tfactors.T9i + -25.3278 * tfactors.T913i + 6.4931 * tfactors.T913 + + -9.27513 * tfactors.T9 + -0.610439 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 102.86202812813134 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -25.3278 * tfactors.T943i + (1.0/3.0) * 6.4931 * tfactors.T923i + + -9.27513 + (5.0/3.0) * -0.610439 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // S32 --> He4 + Si28 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real S32_log_pf, dS32_log_pf_dT9; + + // interpolating S32 partition function + get_partition_function_cached(S32, tfactors.T9, pf_cache, S32_log_pf, dS32_log_pf_dT9); + + amrex::Real Si28_log_pf, dSi28_log_pf_dT9; + + // interpolating Si28 partition function + get_partition_function_cached(Si28, tfactors.T9, pf_cache, Si28_log_pf, dSi28_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Si28_log_pf - S32_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dSi28_log_pf_dT9 - dS32_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 72.8147025119699 + -80.62419844573513 * tfactors.T9i + -59.4896 * tfactors.T913i + 4.47205 * tfactors.T913 + + -4.78989 * tfactors.T9 + 0.557201 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 80.62419844573513 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -59.4896 * tfactors.T943i + (1.0/3.0) * 4.47205 * tfactors.T923i + + -4.78989 + (5.0/3.0) * 0.557201 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_S33_to_He4_Si29_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // S33 --> He4 + Si29 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Si29_log_pf, dSi29_log_pf_dT9; + + // interpolating Si29 partition function + get_partition_function_cached(Si29, tfactors.T9, pf_cache, Si29_log_pf, dSi29_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real S33_log_pf, dS33_log_pf_dT9; + + // interpolating S33 partition function + get_partition_function_cached(S33, tfactors.T9, pf_cache, S33_log_pf, dS33_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Si29_log_pf - S33_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dSi29_log_pf_dT9 - dS33_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 73.77254890676622 + -82.57418453637936 * tfactors.T9i + -59.5755 * tfactors.T913i + 1.06274 * tfactors.T913 + + -3.07529 * tfactors.T9 + 0.372011 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 82.57418453637936 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -59.5755 * tfactors.T943i + (1.0/3.0) * 1.06274 * tfactors.T923i + + -3.07529 + (5.0/3.0) * 0.372011 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cl34_to_p_S33_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cl34 --> p + S33 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cl34_log_pf, dCl34_log_pf_dT9; + + // interpolating Cl34 partition function + get_partition_function_cached(Cl34, tfactors.T9, pf_cache, Cl34_log_pf, dCl34_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real S33_log_pf, dS33_log_pf_dT9; + + // interpolating S33 partition function + get_partition_function_cached(S33, tfactors.T9, pf_cache, S33_log_pf, dS33_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + S33_log_pf - Cl34_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dS33_log_pf_dT9 - dCl34_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 61.557325011533386 + -59.684389677674176 * tfactors.T9i + -26.777 * tfactors.T913i + -5.96882 * tfactors.T913 + + -1.0706 * tfactors.T9 + 0.19692 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 59.684389677674176 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.777 * tfactors.T943i + (1.0/3.0) * -5.96882 * tfactors.T923i + + -1.0706 + (5.0/3.0) * 0.19692 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cl34_to_He4_P30_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cl34 --> He4 + P30 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cl34_log_pf, dCl34_log_pf_dT9; + + // interpolating Cl34 partition function + get_partition_function_cached(Cl34, tfactors.T9, pf_cache, Cl34_log_pf, dCl34_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real P30_log_pf, dP30_log_pf_dT9; + + // interpolating P30 partition function + get_partition_function_cached(P30, tfactors.T9, pf_cache, P30_log_pf, dP30_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + P30_log_pf - Cl34_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dP30_log_pf_dT9 - dCl34_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 71.33676737375008 + -77.33420151312718 * tfactors.T9i + -62.4643 * tfactors.T913i + -3.19028 * tfactors.T913 + + -0.832633 * tfactors.T9 + 0.0987525 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 77.33420151312718 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -62.4643 * tfactors.T943i + (1.0/3.0) * -3.19028 * tfactors.T923i + + -0.832633 + (5.0/3.0) * 0.0987525 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cl35_to_He4_P31_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cl35 --> He4 + P31 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Cl35_log_pf, dCl35_log_pf_dT9; + + // interpolating Cl35 partition function + get_partition_function_cached(Cl35, tfactors.T9, pf_cache, Cl35_log_pf, dCl35_log_pf_dT9); + + amrex::Real P31_log_pf, dP31_log_pf_dT9; + + // interpolating P31 partition function + get_partition_function_cached(P31, tfactors.T9, pf_cache, P31_log_pf, dP31_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + P31_log_pf - Cl35_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dP31_log_pf_dT9 - dCl35_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 74.6695981567728 + -81.20727442147438 * tfactors.T9i + -62.5433 * tfactors.T913i + -2.95026 * tfactors.T913 + + -0.89652 * tfactors.T9 + 0.0774126 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 81.20727442147438 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -62.5433 * tfactors.T943i + (1.0/3.0) * -2.95026 * tfactors.T923i + + -0.89652 + (5.0/3.0) * 0.0774126 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ar36_to_p_Cl35_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ar36 --> p + Cl35 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Cl35_log_pf, dCl35_log_pf_dT9; + + // interpolating Cl35 partition function + get_partition_function_cached(Cl35, tfactors.T9, pf_cache, Cl35_log_pf, dCl35_log_pf_dT9); + + amrex::Real Ar36_log_pf, dAr36_log_pf_dT9; + + // interpolating Ar36 partition function + get_partition_function_cached(Ar36, tfactors.T9, pf_cache, Ar36_log_pf, dAr36_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Cl35_log_pf - Ar36_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCl35_log_pf_dT9 - dAr36_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -17.455589662878502 + -99.28409012589869 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 99.28409012589869 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 60.7561103371215 + -98.71943912589869 * tfactors.T9i + -27.8971 * tfactors.T913i + -16.2304 * tfactors.T913 + + 35.255 * tfactors.T9 + -25.8411 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 98.71943912589869 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -27.8971 * tfactors.T943i + (1.0/3.0) * -16.2304 * tfactors.T923i + + 35.255 + (5.0/3.0) * -25.8411 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 17.222320337121502 + -102.37035912589869 * tfactors.T9i + 18.0179 * tfactors.T913 + + -2.86304 * tfactors.T9 + 0.250854 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 102.37035912589869 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0179 * tfactors.T923i + + -2.86304 + (5.0/3.0) * 0.250854 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 16.0363703371215 + -100.7293991258987 * tfactors.T9i; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 100.7293991258987 * tfactors.T9i * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ar36_to_He4_S32_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ar36 --> He4 + S32 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real S32_log_pf, dS32_log_pf_dT9; + + // interpolating S32 partition function + get_partition_function_cached(S32, tfactors.T9, pf_cache, S32_log_pf, dS32_log_pf_dT9); + + amrex::Real Ar36_log_pf, dAr36_log_pf_dT9; + + // interpolating Ar36 partition function + get_partition_function_cached(Ar36, tfactors.T9, pf_cache, Ar36_log_pf, dAr36_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + S32_log_pf - Ar36_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dS32_log_pf_dT9 - dAr36_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 73.81807507159112 + -77.06468541928012 * tfactors.T9i + -65.3709 * tfactors.T913i + 5.68294 * tfactors.T913 + + -5.00388 * tfactors.T9 + 0.571407 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 77.06468541928012 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -65.3709 * tfactors.T943i + (1.0/3.0) * 5.68294 * tfactors.T923i + + -5.00388 + (5.0/3.0) * 0.571407 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ar37_to_He4_S33_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ar37 --> He4 + S33 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ar37_log_pf, dAr37_log_pf_dT9; + + // interpolating Ar37 partition function + get_partition_function_cached(Ar37, tfactors.T9, pf_cache, Ar37_log_pf, dAr37_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real S33_log_pf, dS33_log_pf_dT9; + + // interpolating S33 partition function + get_partition_function_cached(S33, tfactors.T9, pf_cache, S33_log_pf, dS33_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + S33_log_pf - Ar37_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dS33_log_pf_dT9 - dAr37_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 74.85364487556038 + -78.75681911725914 * tfactors.T9i + -65.4446 * tfactors.T913i + 3.59607 * tfactors.T913 + + -3.40501 * tfactors.T9 + 0.363961 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 78.75681911725914 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -65.4446 * tfactors.T943i + (1.0/3.0) * 3.59607 * tfactors.T923i + + -3.40501 + (5.0/3.0) * 0.363961 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_K38_to_p_Ar37_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // K38 --> p + Ar37 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ar37_log_pf, dAr37_log_pf_dT9; + + // interpolating Ar37 partition function + get_partition_function_cached(Ar37, tfactors.T9, pf_cache, Ar37_log_pf, dAr37_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real K38_log_pf, dK38_log_pf_dT9; + + // interpolating K38 partition function + get_partition_function_cached(K38, tfactors.T9, pf_cache, K38_log_pf, dK38_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Ar37_log_pf - K38_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dAr37_log_pf_dT9 - dK38_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 60.85081421447474 + -59.67102475410763 * tfactors.T9i + -28.9954 * tfactors.T913i + -5.57966 * tfactors.T913 + + -1.27516 * tfactors.T9 + 0.217568 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 59.67102475410763 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -28.9954 * tfactors.T943i + (1.0/3.0) * -5.57966 * tfactors.T923i + + -1.27516 + (5.0/3.0) * 0.217568 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_K38_to_He4_Cl34_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // K38 --> He4 + Cl34 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cl34_log_pf, dCl34_log_pf_dT9; + + // interpolating Cl34 partition function + get_partition_function_cached(Cl34, tfactors.T9, pf_cache, Cl34_log_pf, dCl34_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real K38_log_pf, dK38_log_pf_dT9; + + // interpolating K38 partition function + get_partition_function_cached(K38, tfactors.T9, pf_cache, K38_log_pf, dK38_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Cl34_log_pf - K38_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCl34_log_pf_dT9 - dK38_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 70.93993407850172 + -78.74345419369978 * tfactors.T9i + -68.2165 * tfactors.T913i + -2.18792 * tfactors.T913 + + -1.25322 * tfactors.T9 + 0.140901 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 78.74345419369978 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -68.2165 * tfactors.T943i + (1.0/3.0) * -2.18792 * tfactors.T923i + + -1.25322 + (5.0/3.0) * 0.140901 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_K39_to_He4_Cl35_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // K39 --> He4 + Cl35 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Cl35_log_pf, dCl35_log_pf_dT9; + + // interpolating Cl35 partition function + get_partition_function_cached(Cl35, tfactors.T9, pf_cache, Cl35_log_pf, dCl35_log_pf_dT9); + + amrex::Real K39_log_pf, dK39_log_pf_dT9; + + // interpolating K39 partition function + get_partition_function_cached(K39, tfactors.T9, pf_cache, K39_log_pf, dK39_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Cl35_log_pf - K39_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCl35_log_pf_dT9 - dK39_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 77.64945910439207 + -83.76815251770985 * tfactors.T9i + -68.2848 * tfactors.T913i + 0.0178545 * tfactors.T913 + + -2.06783 * tfactors.T9 + 0.199659 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 83.76815251770985 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -68.2848 * tfactors.T943i + (1.0/3.0) * 0.0178545 * tfactors.T923i + + -2.06783 + (5.0/3.0) * 0.199659 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ca40_to_p_K39_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ca40 --> p + K39 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca40_log_pf, dCa40_log_pf_dT9; + + // interpolating Ca40 partition function + get_partition_function_cached(Ca40, tfactors.T9, pf_cache, Ca40_log_pf, dCa40_log_pf_dT9); + + amrex::Real K39_log_pf, dK39_log_pf_dT9; + + // interpolating K39 partition function + get_partition_function_cached(K39, tfactors.T9, pf_cache, K39_log_pf, dK39_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + K39_log_pf - Ca40_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dK39_log_pf_dT9 - dCa40_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from lo18r + ln_set_rate = 2786.453572485239 + -101.86683326322635 * tfactors.T9i + 802.18 * tfactors.T913i + -4010.27 * tfactors.T913 + + 1137.69 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 101.86683326322635 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 802.18 * tfactors.T943i + (1.0/3.0) * -4010.27 * tfactors.T923i + + 1137.69 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from lo18r + ln_set_rate = 613.1725724852387 + -109.20919326322635 * tfactors.T9i + 641.844 * tfactors.T913i + -1248.49 * tfactors.T913 + + 566.426 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 109.20919326322635 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 641.844 * tfactors.T943i + (1.0/3.0) * -1248.49 * tfactors.T923i + + 566.426 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from lo18r + ln_set_rate = 127.32557248523868 + -98.30957326322635 * tfactors.T9i + 41.1723 * tfactors.T913i + -149.299 * tfactors.T913 + + 10.5229 * tfactors.T9 + -0.68208 * tfactors.T953 + 60.7367 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 98.30957326322635 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 41.1723 * tfactors.T943i + (1.0/3.0) * -149.299 * tfactors.T923i + + 10.5229 + (5.0/3.0) * -0.68208 * tfactors.T923 + 60.7367 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ca40_to_He4_Ar36_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ca40 --> He4 + Ar36 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca40_log_pf, dCa40_log_pf_dT9; + + // interpolating Ca40 partition function + get_partition_function_cached(Ca40, tfactors.T9, pf_cache, Ca40_log_pf, dCa40_log_pf_dT9); + + amrex::Real Ar36_log_pf, dAr36_log_pf_dT9; + + // interpolating Ar36 partition function + get_partition_function_cached(Ar36, tfactors.T9, pf_cache, Ar36_log_pf, dAr36_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ar36_log_pf - Ca40_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dAr36_log_pf_dT9 - dCa40_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 77.28432125250924 + -81.69320665503751 * tfactors.T9i + -71.0046 * tfactors.T913i + 4.0656 * tfactors.T913 + + -5.26509 * tfactors.T9 + 0.683546 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 81.69320665503751 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -71.0046 * tfactors.T943i + (1.0/3.0) * 4.0656 * tfactors.T923i + + -5.26509 + (5.0/3.0) * 0.683546 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ca41_to_He4_Ar37_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ca41 --> He4 + Ar37 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ar37_log_pf, dAr37_log_pf_dT9; + + // interpolating Ar37 partition function + get_partition_function_cached(Ar37, tfactors.T9, pf_cache, Ar37_log_pf, dAr37_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca41_log_pf, dCa41_log_pf_dT9; + + // interpolating Ca41 partition function + get_partition_function_cached(Ca41, tfactors.T9, pf_cache, Ca41_log_pf, dCa41_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ar37_log_pf - Ca41_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dAr37_log_pf_dT9 - dCa41_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 76.99880461067016 + -76.76558012507475 * tfactors.T9i + -71.0688 * tfactors.T913i + 2.71847 * tfactors.T913 + + -3.17333 * tfactors.T9 + 0.335323 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 76.76558012507475 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -71.0688 * tfactors.T943i + (1.0/3.0) * 2.71847 * tfactors.T923i + + -3.17333 + (5.0/3.0) * 0.335323 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Sc42_to_p_Ca41_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Sc42 --> p + Ca41 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Sc42_log_pf, dSc42_log_pf_dT9; + + // interpolating Sc42 partition function + get_partition_function_cached(Sc42, tfactors.T9, pf_cache, Sc42_log_pf, dSc42_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca41_log_pf, dCa41_log_pf_dT9; + + // interpolating Ca41 partition function + get_partition_function_cached(Ca41, tfactors.T9, pf_cache, Ca41_log_pf, dCa41_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Ca41_log_pf - Sc42_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCa41_log_pf_dT9 - dSc42_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 65.08329070961724 + -49.5752100335526 * tfactors.T9i + -31.1321 * tfactors.T913i + -6.33393 * tfactors.T913 + + -1.39316 * tfactors.T9 + 0.255024 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 49.5752100335526 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -31.1321 * tfactors.T943i + (1.0/3.0) * -6.33393 * tfactors.T923i + + -1.39316 + (5.0/3.0) * 0.255024 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Sc42_to_He4_K38_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Sc42 --> He4 + K38 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Sc42_log_pf, dSc42_log_pf_dT9; + + // interpolating Sc42 partition function + get_partition_function_cached(Sc42, tfactors.T9, pf_cache, Sc42_log_pf, dSc42_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real K38_log_pf, dK38_log_pf_dT9; + + // interpolating K38 partition function + get_partition_function_cached(K38, tfactors.T9, pf_cache, K38_log_pf, dK38_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + K38_log_pf - Sc42_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dK38_log_pf_dT9 - dSc42_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 80.14878110581267 + -66.66976540451253 * tfactors.T9i + -73.7407 * tfactors.T913i + -7.08848 * tfactors.T913 + + 0.322473 * tfactors.T9 + -0.0523557 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 66.66976540451253 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -73.7407 * tfactors.T943i + (1.0/3.0) * -7.08848 * tfactors.T923i + + 0.322473 + (5.0/3.0) * -0.0523557 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Sc43_to_He4_K39_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Sc43 --> He4 + K39 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real K39_log_pf, dK39_log_pf_dT9; + + // interpolating K39 partition function + get_partition_function_cached(K39, tfactors.T9, pf_cache, K39_log_pf, dK39_log_pf_dT9); + + amrex::Real Sc43_log_pf, dSc43_log_pf_dT9; + + // interpolating Sc43 partition function + get_partition_function_cached(Sc43, tfactors.T9, pf_cache, Sc43_log_pf, dSc43_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + K39_log_pf - Sc43_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dK39_log_pf_dT9 - dSc43_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 78.37420492735454 + -55.76923537484507 * tfactors.T9i + -73.8006 * tfactors.T913i + 1.87885 * tfactors.T913 + + -2.75862 * tfactors.T9 + 0.279678 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 55.76923537484507 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -73.8006 * tfactors.T943i + (1.0/3.0) * 1.87885 * tfactors.T923i + + -2.75862 + (5.0/3.0) * 0.279678 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ti44_to_p_Sc43_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ti44 --> p + Sc43 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ti44_log_pf, dTi44_log_pf_dT9; + + // interpolating Ti44 partition function + get_partition_function_cached(Ti44, tfactors.T9, pf_cache, Ti44_log_pf, dTi44_log_pf_dT9); + + amrex::Real Sc43_log_pf, dSc43_log_pf_dT9; + + // interpolating Sc43 partition function + get_partition_function_cached(Sc43, tfactors.T9, pf_cache, Sc43_log_pf, dSc43_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Sc43_log_pf - Ti44_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dSc43_log_pf_dT9 - dTi44_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 62.61343220623275 + -100.37294370395585 * tfactors.T9i + -32.1734 * tfactors.T913i + -1.77078 * tfactors.T913 + + -2.21706 * tfactors.T9 + 0.298499 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 100.37294370395585 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * -1.77078 * tfactors.T923i + + -2.21706 + (5.0/3.0) * 0.298499 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ti44_to_He4_Ca40_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ti44 --> He4 + Ca40 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca40_log_pf, dCa40_log_pf_dT9; + + // interpolating Ca40 partition function + get_partition_function_cached(Ca40, tfactors.T9, pf_cache, Ca40_log_pf, dCa40_log_pf_dT9); + + amrex::Real Ti44_log_pf, dTi44_log_pf_dT9; + + // interpolating Ti44 partition function + get_partition_function_cached(Ti44, tfactors.T9, pf_cache, Ti44_log_pf, dTi44_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ca40_log_pf - Ti44_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCa40_log_pf_dT9 - dTi44_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from chw0 + ln_set_rate = 78.7006646483486 + -59.49768581557457 * tfactors.T9i + -76.4273 * tfactors.T913i + 3.87451 * tfactors.T913 + + -3.61477 * tfactors.T9 + 0.367451 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 59.49768581557457 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -76.4273 * tfactors.T943i + (1.0/3.0) * 3.87451 * tfactors.T923i + + -3.61477 + (5.0/3.0) * 0.367451 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ti45_to_He4_Ca41_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ti45 --> He4 + Ca41 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca41_log_pf, dCa41_log_pf_dT9; + + // interpolating Ca41 partition function + get_partition_function_cached(Ca41, tfactors.T9, pf_cache, Ca41_log_pf, dCa41_log_pf_dT9); + + amrex::Real Ti45_log_pf, dTi45_log_pf_dT9; + + // interpolating Ti45 partition function + get_partition_function_cached(Ti45, tfactors.T9, pf_cache, Ti45_log_pf, dTi45_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ca41_log_pf - Ti45_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCa41_log_pf_dT9 - dTi45_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 79.58456857742877 + -73.07720008533106 * tfactors.T9i + -76.4839 * tfactors.T913i + 3.03748 * tfactors.T913 + + -2.59814 * tfactors.T9 + 0.210582 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 73.07720008533106 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -76.4839 * tfactors.T943i + (1.0/3.0) * 3.03748 * tfactors.T923i + + -2.59814 + (5.0/3.0) * 0.210582 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_V46_to_p_Ti45_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // V46 --> p + Ti45 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real V46_log_pf, dV46_log_pf_dT9; + + // interpolating V46 partition function + get_partition_function_cached(V46, tfactors.T9, pf_cache, V46_log_pf, dV46_log_pf_dT9); + + amrex::Real Ti45_log_pf, dTi45_log_pf_dT9; + + // interpolating Ti45 partition function + get_partition_function_cached(Ti45, tfactors.T9, pf_cache, Ti45_log_pf, dTi45_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Ti45_log_pf - V46_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dTi45_log_pf_dT9 - dV46_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 63.21835285453139 + -62.13721694532568 * tfactors.T9i + -33.1981 * tfactors.T913i + -1.66837 * tfactors.T913 + + -2.50285 * tfactors.T9 + 0.349152 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 62.13721694532568 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -33.1981 * tfactors.T943i + (1.0/3.0) * -1.66837 * tfactors.T923i + + -2.50285 + (5.0/3.0) * 0.349152 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_V46_to_He4_Sc42_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // V46 --> He4 + Sc42 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Sc42_log_pf, dSc42_log_pf_dT9; + + // interpolating Sc42 partition function + get_partition_function_cached(Sc42, tfactors.T9, pf_cache, Sc42_log_pf, dSc42_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real V46_log_pf, dV46_log_pf_dT9; + + // interpolating V46 partition function + get_partition_function_cached(V46, tfactors.T9, pf_cache, V46_log_pf, dV46_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Sc42_log_pf - V46_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dSc42_log_pf_dT9 - dV46_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 76.73003072234292 + -85.63920699713294 * tfactors.T9i + -79.0687 * tfactors.T913i + -4.25493 * tfactors.T913 + + 0.184703 * tfactors.T9 + -0.0785452 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 85.63920699713294 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -79.0687 * tfactors.T943i + (1.0/3.0) * -4.25493 * tfactors.T923i + + 0.184703 + (5.0/3.0) * -0.0785452 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_V47_to_He4_Sc43_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // V47 --> He4 + Sc43 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real V47_log_pf, dV47_log_pf_dT9; + + // interpolating V47 partition function + get_partition_function_cached(V47, tfactors.T9, pf_cache, V47_log_pf, dV47_log_pf_dT9); + + amrex::Real Sc43_log_pf, dSc43_log_pf_dT9; + + // interpolating Sc43 partition function + get_partition_function_cached(Sc43, tfactors.T9, pf_cache, Sc43_log_pf, dSc43_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Sc43_log_pf - V47_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dSc43_log_pf_dT9 - dV47_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 84.67304382470803 + -95.66632297040007 * tfactors.T9i + -79.122 * tfactors.T913i + -7.07006 * tfactors.T913 + + 0.424183 * tfactors.T9 + -0.0665231 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 95.66632297040007 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -79.122 * tfactors.T943i + (1.0/3.0) * -7.07006 * tfactors.T923i + + 0.424183 + (5.0/3.0) * -0.0665231 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cr48_to_p_V47_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cr48 --> p + V47 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cr48_log_pf, dCr48_log_pf_dT9; + + // interpolating Cr48 partition function + get_partition_function_cached(Cr48, tfactors.T9, pf_cache, Cr48_log_pf, dCr48_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real V47_log_pf, dV47_log_pf_dT9; + + // interpolating V47 partition function + get_partition_function_cached(V47, tfactors.T9, pf_cache, V47_log_pf, dV47_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + V47_log_pf - Cr48_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dV47_log_pf_dT9 - dCr48_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from nfisn + ln_set_rate = 67.75975303984967 + -100.08956223422913 * tfactors.T9i + -34.0548 * tfactors.T913i + -3.41973 * tfactors.T913 + + 1.16501 * tfactors.T9 + -0.105543 * tfactors.T953 + -6.20886 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 100.08956223422913 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.0548 * tfactors.T943i + (1.0/3.0) * -3.41973 * tfactors.T923i + + 1.16501 + (5.0/3.0) * -0.105543 * tfactors.T923 + -6.20886 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nfisn + ln_set_rate = 536.5429530398497 + -99.32517223422914 * tfactors.T9i + 317.171 * tfactors.T913i + -911.679 * tfactors.T913 + + 94.4245 * tfactors.T9 + -10.1973 * tfactors.T953 + 332.227 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 99.32517223422914 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 317.171 * tfactors.T943i + (1.0/3.0) * -911.679 * tfactors.T923i + + 94.4245 + (5.0/3.0) * -10.1973 * tfactors.T923 + 332.227 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nfisn + ln_set_rate = 48.911453039849675 + -93.78359723422915 * tfactors.T9i + -45.9868 * tfactors.T913i + 13.6822 * tfactors.T913 + + -0.376902 * tfactors.T9 + -0.0194875 * tfactors.T953 + -6.9232499999999995 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 93.78359723422915 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -45.9868 * tfactors.T943i + (1.0/3.0) * 13.6822 * tfactors.T923i + + -0.376902 + (5.0/3.0) * -0.0194875 * tfactors.T923 + -6.9232499999999995 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nfisn + ln_set_rate = 65.64255303984967 + -94.54467623422914 * tfactors.T9i + -110.655 * tfactors.T913i + 83.0232 * tfactors.T913 + + -19.7762 * tfactors.T9 + 3.03961 * tfactors.T953 + -47.9742 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 94.54467623422914 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -110.655 * tfactors.T943i + (1.0/3.0) * 83.0232 * tfactors.T923i + + -19.7762 + (5.0/3.0) * 3.03961 * tfactors.T923 + -47.9742 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cr48_to_He4_Ti44_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cr48 --> He4 + Ti44 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cr48_log_pf, dCr48_log_pf_dT9; + + // interpolating Cr48 partition function + get_partition_function_cached(Cr48, tfactors.T9, pf_cache, Cr48_log_pf, dCr48_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ti44_log_pf, dTi44_log_pf_dT9; + + // interpolating Ti44 partition function + get_partition_function_cached(Ti44, tfactors.T9, pf_cache, Ti44_log_pf, dTi44_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ti44_log_pf - Cr48_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dTi44_log_pf_dT9 - dCr48_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 89.75906465832496 + -89.32364150067336 * tfactors.T9i + -81.667 * tfactors.T913i + -10.6333 * tfactors.T913 + + -0.672613 * tfactors.T9 + 0.161209 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 89.32364150067336 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -81.667 * tfactors.T943i + (1.0/3.0) * -10.6333 * tfactors.T923i + + -0.672613 + (5.0/3.0) * 0.161209 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cr49_to_He4_Ti45_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cr49 --> He4 + Ti45 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Cr49_log_pf, dCr49_log_pf_dT9; + + // interpolating Cr49 partition function + get_partition_function_cached(Cr49, tfactors.T9, pf_cache, Cr49_log_pf, dCr49_log_pf_dT9); + + amrex::Real Ti45_log_pf, dTi45_log_pf_dT9; + + // interpolating Ti45 partition function + get_partition_function_cached(Ti45, tfactors.T9, pf_cache, Ti45_log_pf, dTi45_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ti45_log_pf - Cr49_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dTi45_log_pf_dT9 - dCr49_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 89.2767795487736 + -101.50490417292947 * tfactors.T9i + -81.7175 * tfactors.T913i + -10.1755 * tfactors.T913 + + 0.364167 * tfactors.T9 + -0.000317666 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 101.50490417292947 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -81.7175 * tfactors.T943i + (1.0/3.0) * -10.1755 * tfactors.T923i + + 0.364167 + (5.0/3.0) * -0.000317666 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mn50_to_p_Cr49_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn50 --> p + Cr49 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Mn50_log_pf, dMn50_log_pf_dT9; + + // interpolating Mn50 partition function + get_partition_function_cached(Mn50, tfactors.T9, pf_cache, Mn50_log_pf, dMn50_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Cr49_log_pf, dCr49_log_pf_dT9; + + // interpolating Cr49 partition function + get_partition_function_cached(Cr49, tfactors.T9, pf_cache, Cr49_log_pf, dCr49_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Cr49_log_pf - Mn50_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCr49_log_pf_dT9 - dMn50_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 61.87490359919837 + -53.188856976553964 * tfactors.T9i + -35.2018 * tfactors.T913i + 0.168579 * tfactors.T913 + + -2.87983 * tfactors.T9 + 0.378768 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 53.188856976553964 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -35.2018 * tfactors.T943i + (1.0/3.0) * 0.168579 * tfactors.T923i + + -2.87983 + (5.0/3.0) * 0.378768 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mn50_to_He4_V46_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn50 --> He4 + V46 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Mn50_log_pf, dMn50_log_pf_dT9; + + // interpolating Mn50 partition function + get_partition_function_cached(Mn50, tfactors.T9, pf_cache, Mn50_log_pf, dMn50_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real V46_log_pf, dV46_log_pf_dT9; + + // interpolating V46 partition function + get_partition_function_cached(V46, tfactors.T9, pf_cache, V46_log_pf, dV46_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + V46_log_pf - Mn50_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dV46_log_pf_dT9 - dMn50_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 79.2797302934406 + -92.55654420415776 * tfactors.T9i + -84.2255 * tfactors.T913i + -4.85634 * tfactors.T913 + + 0.0528515 * tfactors.T9 + -0.0425496 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 92.55654420415776 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -84.2255 * tfactors.T943i + (1.0/3.0) * -4.85634 * tfactors.T923i + + 0.0528515 + (5.0/3.0) * -0.0425496 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mn51_to_He4_V47_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn51 --> He4 + V47 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Mn51_log_pf, dMn51_log_pf_dT9; + + // interpolating Mn51 partition function + get_partition_function_cached(Mn51, tfactors.T9, pf_cache, Mn51_log_pf, dMn51_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real V47_log_pf, dV47_log_pf_dT9; + + // interpolating V47 partition function + get_partition_function_cached(V47, tfactors.T9, pf_cache, V47_log_pf, dV47_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + V47_log_pf - Mn51_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dV47_log_pf_dT9 - dMn51_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 81.42763571008429 + -100.50726374990671 * tfactors.T9i + -84.2732 * tfactors.T913i + -2.98061 * tfactors.T913 + + -0.531361 * tfactors.T9 + 0.023612 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 100.50726374990671 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -84.2732 * tfactors.T943i + (1.0/3.0) * -2.98061 * tfactors.T923i + + -0.531361 + (5.0/3.0) * 0.023612 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Fe52_to_p_Mn51_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe52 --> p + Mn51 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Mn51_log_pf, dMn51_log_pf_dT9; + + // interpolating Mn51 partition function + get_partition_function_cached(Mn51, tfactors.T9, pf_cache, Mn51_log_pf, dMn51_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe52_log_pf, dFe52_log_pf_dT9; + + // interpolating Fe52 partition function + get_partition_function_cached(Fe52, tfactors.T9, pf_cache, Fe52_log_pf, dFe52_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Mn51_log_pf - Fe52_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dMn51_log_pf_dT9 - dFe52_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 61.74743132228039 + -85.61663846070292 * tfactors.T9i + -36.1825 * tfactors.T913i + 0.873042 * tfactors.T913 + + -2.89731 * tfactors.T9 + 0.364394 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 85.61663846070292 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.1825 * tfactors.T943i + (1.0/3.0) * 0.873042 * tfactors.T923i + + -2.89731 + (5.0/3.0) * 0.364394 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Fe52_to_He4_Cr48_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe52 --> He4 + Cr48 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cr48_log_pf, dCr48_log_pf_dT9; + + // interpolating Cr48 partition function + get_partition_function_cached(Cr48, tfactors.T9, pf_cache, Cr48_log_pf, dCr48_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe52_log_pf, dFe52_log_pf_dT9; + + // interpolating Fe52 partition function + get_partition_function_cached(Fe52, tfactors.T9, pf_cache, Fe52_log_pf, dFe52_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Cr48_log_pf - Fe52_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCr48_log_pf_dT9 - dFe52_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 90.149113992515 + -92.09363997638769 * tfactors.T9i + -86.7459 * tfactors.T913i + -9.79373 * tfactors.T913 + + -0.772169 * tfactors.T9 + 0.155883 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 92.09363997638769 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * -9.79373 * tfactors.T923i + + -0.772169 + (5.0/3.0) * 0.155883 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Co55_to_He4_Mn51_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co55 --> He4 + Mn51 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Mn51_log_pf, dMn51_log_pf_dT9; + + // interpolating Mn51 partition function + get_partition_function_cached(Mn51, tfactors.T9, pf_cache, Mn51_log_pf, dMn51_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Mn51_log_pf - Co55_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dMn51_log_pf_dT9 - dCo55_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 90.61473213109255 + -95.29300562248025 * tfactors.T9i + -89.274 * tfactors.T913i + -10.4373 * tfactors.T913 + + 1.00492 * tfactors.T9 + -0.125548 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 95.29300562248025 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -10.4373 * tfactors.T923i + + 1.00492 + (5.0/3.0) * -0.125548 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni56 --> p + Co55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ni56_log_pf, dNi56_log_pf_dT9; + + // interpolating Ni56 partition function + get_partition_function_cached(Ni56, tfactors.T9, pf_cache, Ni56_log_pf, dNi56_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Co55_log_pf - Ni56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCo55_log_pf_dT9 - dNi56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 63.15120404192561 + -83.16460378149378 * tfactors.T9i + -38.1053 * tfactors.T913i + -0.210947 * tfactors.T913 + + -2.68377 * tfactors.T9 + 0.355814 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 83.16460378149378 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1053 * tfactors.T943i + (1.0/3.0) * -0.210947 * tfactors.T923i + + -2.68377 + (5.0/3.0) * 0.355814 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni56 --> He4 + Fe52 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ni56_log_pf, dNi56_log_pf_dT9; + + // interpolating Ni56 partition function + get_partition_function_cached(Ni56, tfactors.T9, pf_cache, Ni56_log_pf, dNi56_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe52_log_pf, dFe52_log_pf_dT9; + + // interpolating Fe52 partition function + get_partition_function_cached(Fe52, tfactors.T9, pf_cache, Fe52_log_pf, dFe52_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Fe52_log_pf - Ni56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dFe52_log_pf_dT9 - dNi56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 91.62430485073777 + -92.84097094326391 * tfactors.T9i + -91.6819 * tfactors.T913i + -9.51885 * tfactors.T913 + + -0.533014 * tfactors.T9 + 0.0892607 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 92.84097094326391 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -9.51885 * tfactors.T923i + + -0.533014 + (5.0/3.0) * 0.0892607 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // C12 --> 3 He4 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = He4_log_pf + He4_log_pf + He4_log_pf - C12_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dHe4_log_pf_dT9 + dHe4_log_pf_dT9 - dC12_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from fy05r + ln_set_rate = 34.96090397991297 + -85.44440046993657 * tfactors.T9i + -23.57 * tfactors.T913i + 20.4886 * tfactors.T913 + + -12.9882 * tfactors.T9 + -20.0 * tfactors.T953 + 0.8333300000000001 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 85.44440046993657 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.57 * tfactors.T943i + (1.0/3.0) * 20.4886 * tfactors.T923i + + -12.9882 + (5.0/3.0) * -20.0 * tfactors.T923 + 0.8333300000000001 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from fy05n + ln_set_rate = 45.77825197991297 + -84.41994046993656 * tfactors.T9i + -37.06 * tfactors.T913i + 29.3493 * tfactors.T913 + + -115.507 * tfactors.T9 + -10.0 * tfactors.T953 + 1.66667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 84.41994046993656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.06 * tfactors.T943i + (1.0/3.0) * 29.3493 * tfactors.T923i + + -115.507 + (5.0/3.0) * -10.0 * tfactors.T923 + 1.66667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from fy05r + ln_set_rate = 22.398803979912973 + -88.54650046993656 * tfactors.T9i + -13.49 * tfactors.T913i + 21.4259 * tfactors.T913 + + -1.34769 * tfactors.T9 + 0.0879816 * tfactors.T953 + -10.1653 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 88.54650046993656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.49 * tfactors.T943i + (1.0/3.0) * 21.4259 * tfactors.T923i + + -1.34769 + (5.0/3.0) * 0.0879816 * tfactors.T923 + -10.1653 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_C12_to_p_N15_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // C12 + He4 --> p + N15 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real N15_log_pf, dN15_log_pf_dT9; + + // setting N15 log(partition function) to 0.0 by default, independent of T + N15_log_pf = 0.0_rt; + dN15_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + N15_log_pf - He4_log_pf - C12_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dN15_log_pf_dT9 - dHe4_log_pf_dT9 - dC12_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from nacrn + ln_set_rate = 27.135846229234243 + -57.62215691264642 * tfactors.T9i + -15.253 * tfactors.T913i + 1.59318 * tfactors.T913 + + 2.4479 * tfactors.T9 + -2.19708 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 57.62215691264642 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -15.253 * tfactors.T943i + (1.0/3.0) * 1.59318 * tfactors.T923i + + 2.4479 + (5.0/3.0) * -2.19708 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrr + ln_set_rate = -6.915773770765759 + -58.78595691264642 * tfactors.T9i + 22.7105 * tfactors.T913 + + -2.90707 * tfactors.T9 + 0.205754 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 58.78595691264642 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 22.7105 * tfactors.T923i + + -2.90707 + (5.0/3.0) * 0.205754 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrr + ln_set_rate = 20.556646229234243 + -65.02815691264642 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 65.02815691264642 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrr + ln_set_rate = -5.21402377076576 + -59.643326912646415 * tfactors.T9i + 30.8497 * tfactors.T913 + + -8.50433 * tfactors.T9 + -1.54426 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 59.643326912646415 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 30.8497 * tfactors.T923i + + -8.50433 + (5.0/3.0) * -1.54426 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_N14_to_p_O17_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // N14 + He4 --> p + O17 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real O17_log_pf, dO17_log_pf_dT9; + + // interpolating O17 partition function + get_partition_function_cached(O17, tfactors.T9, pf_cache, O17_log_pf, dO17_log_pf_dT9); + + amrex::Real N14_log_pf, dN14_log_pf_dT9; + + // setting N14 log(partition function) to 0.0 by default, independent of T + N14_log_pf = 0.0_rt; + dN14_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + O17_log_pf - He4_log_pf - N14_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dO17_log_pf_dT9 - dHe4_log_pf_dT9 - dN14_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -7.592359780998223 + -14.584520682879308 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 14.584520682879308 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 19.194270219001776 + -13.831125682879309 * tfactors.T9i + -16.9078 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 13.831125682879309 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -16.9078 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 9.789270219001777 + -18.78977568287931 * tfactors.T9i + 5.10182 * tfactors.T913 + + 0.379373 * tfactors.T9 + -0.0672515 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 18.78977568287931 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.10182 * tfactors.T923i + + 0.379373 + (5.0/3.0) * -0.0672515 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 5.148870219001777 + -15.945895682879309 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 15.945895682879309 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_N15_to_p_O18_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // N15 + He4 --> p + O18 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real O18_log_pf, dO18_log_pf_dT9; + + // interpolating O18 partition function + get_partition_function_cached(O18, tfactors.T9, pf_cache, O18_log_pf, dO18_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real N15_log_pf, dN15_log_pf_dT9; + + // setting N15 log(partition function) to 0.0 by default, independent of T + N15_log_pf = 0.0_rt; + dN15_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + O18_log_pf - He4_log_pf - N15_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dO18_log_pf_dT9 - dHe4_log_pf_dT9 - dN15_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -29.6926341462146 + -46.42955443414268 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 46.42955443414268 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 25.178865853785396 + -46.183670434142684 * tfactors.T9i + -16.6979 * tfactors.T913i + + -3.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 46.183670434142684 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -16.6979 * tfactors.T943i + + (5.0/3.0) * -3.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 7.155285853785398 + -51.50702043414268 * tfactors.T9i + 11.6568 * tfactors.T913 + + -2.16303 * tfactors.T9 + 0.209965 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 51.50702043414268 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 11.6568 * tfactors.T923i + + -2.16303 + (5.0/3.0) * 0.209965 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 8.4842658537854 + -47.84667043414268 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 47.84667043414268 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // O16 + p --> He4 + N13 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real N13_log_pf, dN13_log_pf_dT9; + + // setting N13 log(partition function) to 0.0 by default, independent of T + N13_log_pf = 0.0_rt; + dN13_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = He4_log_pf + N13_log_pf - p_log_pf - O16_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dN13_log_pf_dT9 - dp_log_pf_dT9 - dO16_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88n + ln_set_rate = 42.21642061342456 + -60.557329596678294 * tfactors.T9i + -35.829 * tfactors.T913i + -0.530275 * tfactors.T913 + + -0.982462 * tfactors.T9 + 0.0808059 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 60.557329596678294 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -35.829 * tfactors.T943i + (1.0/3.0) * -0.530275 * tfactors.T923i + + -0.982462 + (5.0/3.0) * 0.0808059 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_O16_to_p_F19_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // O16 + He4 --> p + F19 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real F19_log_pf, dF19_log_pf_dT9; + + // interpolating F19 partition function + get_partition_function_cached(F19, tfactors.T9, pf_cache, F19_log_pf, dF19_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + F19_log_pf - He4_log_pf - O16_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dF19_log_pf_dT9 - dHe4_log_pf_dT9 - dO16_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from nacr + ln_set_rate = -53.121227264044336 + -94.28220973651266 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 94.28220973651266 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacr + ln_set_rate = 25.874672735955667 + -94.15455973651265 * tfactors.T9i + -18.116 * tfactors.T913i + + 1.86674 * tfactors.T9 + -7.5666 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 94.15455973651265 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -18.116 * tfactors.T943i + + 1.86674 + (5.0/3.0) * -7.5666 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacrr + ln_set_rate = 13.941672735955667 + -97.44055973651265 * tfactors.T9i + + -0.21103 * tfactors.T9 + 2.87702 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 97.44055973651265 * tfactors.T9i * tfactors.T9i + + -0.21103 + 2.87702 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacr + ln_set_rate = 14.778572735955667 + -97.90640973651266 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 97.90640973651266 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from nacr + ln_set_rate = 7.822072735955667 + -96.62283973651265 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 96.62283973651265 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne20 + He4 --> p + Na23 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Na23_log_pf, dNa23_log_pf_dT9; + + // interpolating Na23 partition function + get_partition_function_cached(Na23, tfactors.T9, pf_cache, Na23_log_pf, dNa23_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ne20_log_pf, dNe20_log_pf_dT9; + + // interpolating Ne20 partition function + get_partition_function_cached(Ne20, tfactors.T9, pf_cache, Ne20_log_pf, dNe20_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Na23_log_pf - He4_log_pf - Ne20_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dNa23_log_pf_dT9 - dHe4_log_pf_dT9 - dNe20_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -6.360024278486355 + -29.889658832139027 * tfactors.T9i + 19.7297 * tfactors.T913 + + -2.20987 * tfactors.T9 + 0.153374 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 29.889658832139027 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 19.7297 * tfactors.T923i + + -2.20987 + (5.0/3.0) * 0.153374 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 0.24516522151364528 + -29.434918832139026 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 29.434918832139026 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 19.202935721513644 + -27.573888832139026 * tfactors.T9i + -20.0024 * tfactors.T913i + 11.5988 * tfactors.T913 + + -1.37398 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 27.573888832139026 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -20.0024 * tfactors.T943i + (1.0/3.0) * 11.5988 * tfactors.T923i + + -1.37398 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ne20_to_C12_C12_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne20 + He4 --> C12 + C12 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ne20_log_pf, dNe20_log_pf_dT9; + + // interpolating Ne20 partition function + get_partition_function_cached(Ne20, tfactors.T9, pf_cache, Ne20_log_pf, dNe20_log_pf_dT9); + + amrex::Real net_log_pf = C12_log_pf + C12_log_pf - He4_log_pf - Ne20_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dC12_log_pf_dT9 + dC12_log_pf_dT9 - dHe4_log_pf_dT9 - dNe20_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88r + ln_set_rate = 61.474151468919175 + -53.57824966896331 * tfactors.T9i + -84.165 * tfactors.T913i + -1.56627 * tfactors.T913 + + -0.0736084 * tfactors.T9 + -0.072797 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 53.57824966896331 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.56627 * tfactors.T923i + + -0.0736084 + (5.0/3.0) * -0.072797 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne21 + p --> He4 + F18 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ne21_log_pf, dNe21_log_pf_dT9; + + // interpolating Ne21 partition function + get_partition_function_cached(Ne21, tfactors.T9, pf_cache, Ne21_log_pf, dNe21_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real F18_log_pf, dF18_log_pf_dT9; + + // interpolating F18 partition function + get_partition_function_cached(F18, tfactors.T9, pf_cache, F18_log_pf, dF18_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + F18_log_pf - p_log_pf - Ne21_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dF18_log_pf_dT9 - dp_log_pf_dT9 - dNe21_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from rpsmr + ln_set_rate = 50.63668915976785 + -22.04702300768339 * tfactors.T9i + 21.4461 * tfactors.T913i + -73.252 * tfactors.T913 + + 2.42329 * tfactors.T9 + -0.077278 * tfactors.T953 + 40.7604 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 22.04702300768339 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.4461 * tfactors.T943i + (1.0/3.0) * -73.252 * tfactors.T923i + + 2.42329 + (5.0/3.0) * -0.077278 * tfactors.T923 + 40.7604 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ne22_to_He4_F19_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ne22 + p --> He4 + F19 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real F19_log_pf, dF19_log_pf_dT9; + + // interpolating F19 partition function + get_partition_function_cached(F19, tfactors.T9, pf_cache, F19_log_pf, dF19_log_pf_dT9); + + amrex::Real Ne22_log_pf, dNe22_log_pf_dT9; + + // interpolating Ne22 partition function + get_partition_function_cached(Ne22, tfactors.T9, pf_cache, Ne22_log_pf, dNe22_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + F19_log_pf - p_log_pf - Ne22_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dF19_log_pf_dT9 - dp_log_pf_dT9 - dNe22_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from da18r + ln_set_rate = 54.774145434237155 + -22.26126198150658 * tfactors.T9i + -38.7722 * tfactors.T913i + -13.3654 * tfactors.T913 + + 0.863648 * tfactors.T9 + -0.0451491 * tfactors.T953 + 1.33333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 22.26126198150658 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.7722 * tfactors.T943i + (1.0/3.0) * -13.3654 * tfactors.T923i + + 0.863648 + (5.0/3.0) * -0.0451491 * tfactors.T923 + 1.33333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from da18r + ln_set_rate = 53.51334543423716 + -65.19766198150657 * tfactors.T9i + -34.5008 * tfactors.T913i + 56.9316 * tfactors.T913 + + 2.09613 * tfactors.T9 + -32.496 * tfactors.T953 + 0.333333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 65.19766198150657 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.5008 * tfactors.T943i + (1.0/3.0) * 56.9316 * tfactors.T923i + + 2.09613 + (5.0/3.0) * -32.496 * tfactors.T923 + 0.333333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from da18r + ln_set_rate = 29432.442445434237 + -152.44286198150658 * tfactors.T9i + 12625.1 * tfactors.T913i + -49107.1 * tfactors.T913 + + 9227.53 * tfactors.T9 + -2086.65 * tfactors.T953 + 14520.2 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 152.44286198150658 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 12625.1 * tfactors.T943i + (1.0/3.0) * -49107.1 * tfactors.T923i + + 9227.53 + (5.0/3.0) * -2086.65 * tfactors.T923 + 14520.2 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Na23_to_C12_C12_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Na23 + p --> C12 + C12 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real Na23_log_pf, dNa23_log_pf_dT9; + + // interpolating Na23 partition function + get_partition_function_cached(Na23, tfactors.T9, pf_cache, Na23_log_pf, dNa23_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = C12_log_pf + C12_log_pf - p_log_pf - Na23_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dC12_log_pf_dT9 + dC12_log_pf_dT9 - dp_log_pf_dT9 - dNa23_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88r + ln_set_rate = 60.92541574740554 + -26.004360836807496 * tfactors.T9i + -84.165 * tfactors.T913i + -1.4191 * tfactors.T913 + + -0.114619 * tfactors.T9 + -0.070307 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 26.004360836807496 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.4191 * tfactors.T923i + + -0.114619 + (5.0/3.0) * -0.070307 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mg24 + He4 --> p + Al27 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Al27_log_pf, dAl27_log_pf_dT9; + + // interpolating Al27 partition function + get_partition_function_cached(Al27, tfactors.T9, pf_cache, Al27_log_pf, dAl27_log_pf_dT9); + + amrex::Real Mg24_log_pf, dMg24_log_pf_dT9; + + // interpolating Mg24 partition function + get_partition_function_cached(Mg24, tfactors.T9, pf_cache, Mg24_log_pf, dMg24_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + Al27_log_pf - He4_log_pf - Mg24_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dAl27_log_pf_dT9 - dHe4_log_pf_dT9 - dMg24_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -6.4280417530584835 + -22.818701538287602 * tfactors.T9i + 18.0416 * tfactors.T913 + + -1.54137 * tfactors.T9 + 0.0847506 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 22.818701538287602 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0416 * tfactors.T923i + + -1.54137 + (5.0/3.0) * 0.0847506 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -26.268451753058486 + -19.5392135382876 * tfactors.T9i + 5.18642 * tfactors.T913i + -34.7936 * tfactors.T913 + + 168.225 * tfactors.T9 + -115.825 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 19.5392135382876 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 5.18642 * tfactors.T943i + (1.0/3.0) * -34.7936 * tfactors.T923i + + 168.225 + (5.0/3.0) * -115.825 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 30.057448246941515 + -18.576201538287602 * tfactors.T9i + -26.4162 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 18.576201538287602 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.4162 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mg24_to_C12_O16_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mg24 + He4 --> C12 + O16 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mg24_log_pf, dMg24_log_pf_dT9; + + // interpolating Mg24 partition function + get_partition_function_cached(Mg24, tfactors.T9, pf_cache, Mg24_log_pf, dMg24_log_pf_dT9); + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real net_log_pf = C12_log_pf + O16_log_pf - He4_log_pf - Mg24_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dC12_log_pf_dT9 + dO16_log_pf_dT9 - dHe4_log_pf_dT9 - dMg24_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88r + ln_set_rate = 49.57295819231048 + -78.2098115311048 * tfactors.T9i + -133.413 * tfactors.T913i + 50.1572 * tfactors.T913 + + -3.15987 * tfactors.T9 + 0.0178251 * tfactors.T953 + -23.7027 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 78.2098115311048 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -133.413 * tfactors.T943i + (1.0/3.0) * 50.1572 * tfactors.T923i + + -3.15987 + (5.0/3.0) * 0.0178251 * tfactors.T923 + -23.7027 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Mg25_to_He4_Na22_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mg25 + p --> He4 + Na22 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mg25_log_pf, dMg25_log_pf_dT9; + + // interpolating Mg25 partition function + get_partition_function_cached(Mg25, tfactors.T9, pf_cache, Mg25_log_pf, dMg25_log_pf_dT9); + + amrex::Real Na22_log_pf, dNa22_log_pf_dT9; + + // interpolating Na22 partition function + get_partition_function_cached(Na22, tfactors.T9, pf_cache, Na22_log_pf, dNa22_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Na22_log_pf - p_log_pf - Mg25_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dNa22_log_pf_dT9 - dp_log_pf_dT9 - dMg25_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 46.304619578366136 + -36.52330379082377 * tfactors.T9i + -50.0924 * tfactors.T913i + 0.807739 * tfactors.T913 + + -0.956029 * tfactors.T9 + 0.0793321 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 36.52330379082377 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -50.0924 * tfactors.T943i + (1.0/3.0) * 0.807739 * tfactors.T923i + + -0.956029 + (5.0/3.0) * 0.0793321 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Al27_to_C12_O16_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Al27 + p --> C12 + O16 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Al27_log_pf, dAl27_log_pf_dT9; + + // interpolating Al27 partition function + get_partition_function_cached(Al27, tfactors.T9, pf_cache, Al27_log_pf, dAl27_log_pf_dT9); + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real net_log_pf = C12_log_pf + O16_log_pf - p_log_pf - Al27_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dC12_log_pf_dT9 + dO16_log_pf_dT9 - dp_log_pf_dT9 - dAl27_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88r + ln_set_rate = 68.96430994536895 + -59.8005159928172 * tfactors.T9i + -119.242 * tfactors.T913i + 13.3667 * tfactors.T913 + + 0.295425 * tfactors.T9 + -0.267288 * tfactors.T953 + -9.91729 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 59.8005159928172 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.242 * tfactors.T943i + (1.0/3.0) * 13.3667 * tfactors.T923i + + 0.295425 + (5.0/3.0) * -0.267288 * tfactors.T923 + -9.91729 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Si28 + He4 --> p + P31 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real P31_log_pf, dP31_log_pf_dT9; + + // interpolating P31 partition function + get_partition_function_cached(P31, tfactors.T9, pf_cache, P31_log_pf, dP31_log_pf_dT9); + + amrex::Real Si28_log_pf, dSi28_log_pf_dT9; + + // interpolating Si28 partition function + get_partition_function_cached(Si28, tfactors.T9, pf_cache, Si28_log_pf, dSi28_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + P31_log_pf - He4_log_pf - Si28_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dP31_log_pf_dT9 - dHe4_log_pf_dT9 - dSi28_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -11.415669089666713 + -25.663579682396225 * tfactors.T9i + 21.521 * tfactors.T913 + + -1.90355 * tfactors.T9 + 0.092724 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 25.663579682396225 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 21.521 * tfactors.T923i + + -1.90355 + (5.0/3.0) * 0.092724 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -13.441669089666712 + -24.114989682396224 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 24.114989682396224 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 60.360230910333286 + -22.237829682396224 * tfactors.T9i + -31.932 * tfactors.T913i + -77.0334 * tfactors.T913 + + -43.6847 * tfactors.T9 + -4.28955 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 22.237829682396224 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -31.932 * tfactors.T943i + (1.0/3.0) * -77.0334 * tfactors.T923i + + -43.6847 + (5.0/3.0) * -4.28955 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Si28_to_C12_Ne20_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Si28 + He4 --> C12 + Ne20 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Si28_log_pf, dSi28_log_pf_dT9; + + // interpolating Si28 partition function + get_partition_function_cached(Si28, tfactors.T9, pf_cache, Si28_log_pf, dSi28_log_pf_dT9); + + amrex::Real Ne20_log_pf, dNe20_log_pf_dT9; + + // interpolating Ne20 partition function + get_partition_function_cached(Ne20, tfactors.T9, pf_cache, Ne20_log_pf, dNe20_log_pf_dT9); + + amrex::Real net_log_pf = C12_log_pf + Ne20_log_pf - He4_log_pf - Si28_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dC12_log_pf_dT9 + dNe20_log_pf_dT9 - dHe4_log_pf_dT9 - dSi28_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from rolfr + ln_set_rate = -307.7623006031339 + -186.77284344745925 * tfactors.T9i + 514.197 * tfactors.T913i + -200.896 * tfactors.T913 + + -6.42713 * tfactors.T9 + 0.758256 * tfactors.T953 + 236.359 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 186.77284344745925 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 514.197 * tfactors.T943i + (1.0/3.0) * -200.896 * tfactors.T923i + + -6.42713 + (5.0/3.0) * 0.758256 * tfactors.T923 + 236.359 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Si28_to_O16_O16_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Si28 + He4 --> O16 + O16 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real Si28_log_pf, dSi28_log_pf_dT9; + + // interpolating Si28 partition function + get_partition_function_cached(Si28, tfactors.T9, pf_cache, Si28_log_pf, dSi28_log_pf_dT9); + + amrex::Real net_log_pf = O16_log_pf + O16_log_pf - He4_log_pf - Si28_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dO16_log_pf_dT9 + dO16_log_pf_dT9 - dHe4_log_pf_dT9 - dSi28_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88r + ln_set_rate = 97.78921572069022 + -111.60083385054465 * tfactors.T9i + -119.324 * tfactors.T913i + -32.2497 * tfactors.T913 + + 1.46214 * tfactors.T9 + -0.200893 * tfactors.T953 + 13.2148 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 111.60083385054465 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.324 * tfactors.T943i + (1.0/3.0) * -32.2497 * tfactors.T923i + + 1.46214 + (5.0/3.0) * -0.200893 * tfactors.T923 + 13.2148 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Si29_to_He4_Al26_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Si29 + p --> He4 + Al26 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Al26_log_pf, dAl26_log_pf_dT9; + + // interpolating Al26 partition function + get_partition_function_cached(Al26, tfactors.T9, pf_cache, Al26_log_pf, dAl26_log_pf_dT9); + + amrex::Real Si29_log_pf, dSi29_log_pf_dT9; + + // interpolating Si29 partition function + get_partition_function_cached(Si29, tfactors.T9, pf_cache, Si29_log_pf, dSi29_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Al26_log_pf - p_log_pf - Si29_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dAl26_log_pf_dT9 - dp_log_pf_dT9 - dSi29_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 50.61935001156578 + -55.94406249988892 * tfactors.T9i + -56.4422 * tfactors.T913i + 0.705353 * tfactors.T913 + + -0.957427 * tfactors.T9 + 0.0756045 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 55.94406249988892 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -56.4422 * tfactors.T943i + (1.0/3.0) * 0.705353 * tfactors.T923i + + -0.957427 + (5.0/3.0) * 0.0756045 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_P31_to_C12_Ne20_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // P31 + p --> C12 + Ne20 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real C12_log_pf, dC12_log_pf_dT9; + + // setting C12 log(partition function) to 0.0 by default, independent of T + C12_log_pf = 0.0_rt; + dC12_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real P31_log_pf, dP31_log_pf_dT9; + + // interpolating P31 partition function + get_partition_function_cached(P31, tfactors.T9, pf_cache, P31_log_pf, dP31_log_pf_dT9); + + amrex::Real Ne20_log_pf, dNe20_log_pf_dT9; + + // interpolating Ne20 partition function + get_partition_function_cached(Ne20, tfactors.T9, pf_cache, Ne20_log_pf, dNe20_log_pf_dT9); + + amrex::Real net_log_pf = C12_log_pf + Ne20_log_pf - p_log_pf - P31_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dC12_log_pf_dT9 + dNe20_log_pf_dT9 - dp_log_pf_dT9 - dP31_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from rolfr + ln_set_rate = -266.47063151346725 + -156.07991376506303 * tfactors.T9i + 361.154 * tfactors.T913i + -92.643 * tfactors.T913 + + -9.98738 * tfactors.T9 + 0.892737 * tfactors.T953 + 161.042 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 156.07991376506303 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 361.154 * tfactors.T943i + (1.0/3.0) * -92.643 * tfactors.T923i + + -9.98738 + (5.0/3.0) * 0.892737 * tfactors.T923 + 161.042 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_P31_to_O16_O16_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // P31 + p --> O16 + O16 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real O16_log_pf, dO16_log_pf_dT9; + + // interpolating O16 partition function + get_partition_function_cached(O16, tfactors.T9, pf_cache, O16_log_pf, dO16_log_pf_dT9); + + amrex::Real P31_log_pf, dP31_log_pf_dT9; + + // interpolating P31 partition function + get_partition_function_cached(P31, tfactors.T9, pf_cache, P31_log_pf, dP31_log_pf_dT9); + + amrex::Real net_log_pf = O16_log_pf + O16_log_pf - p_log_pf - P31_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dO16_log_pf_dT9 + dO16_log_pf_dT9 - dp_log_pf_dT9 - dP31_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from cf88r + ln_set_rate = 86.33118481035693 + -88.87103716814843 * tfactors.T9i + -145.844 * tfactors.T913i + 8.72612 * tfactors.T913 + + -0.554035 * tfactors.T9 + -0.137562 * tfactors.T953 + -6.88807 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 88.87103716814843 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -145.844 * tfactors.T943i + (1.0/3.0) * 8.72612 * tfactors.T923i + + -0.554035 + (5.0/3.0) * -0.137562 * tfactors.T923 + -6.88807 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_S32_to_p_Cl35_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // S32 + He4 --> p + Cl35 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Cl35_log_pf, dCl35_log_pf_dT9; + + // interpolating Cl35 partition function + get_partition_function_cached(Cl35, tfactors.T9, pf_cache, Cl35_log_pf, dCl35_log_pf_dT9); + + amrex::Real S32_log_pf, dS32_log_pf_dT9; + + // interpolating S32 partition function + get_partition_function_cached(S32, tfactors.T9, pf_cache, S32_log_pf, dS32_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + Cl35_log_pf - He4_log_pf - S32_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCl35_log_pf_dT9 - dHe4_log_pf_dT9 - dS32_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from il10r + ln_set_rate = -0.8597847344696254 + -25.589703706656966 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 25.589703706656966 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = -57.37716473446963 + -22.187684706656967 * tfactors.T9i + 25.5338 * tfactors.T913 + + 6.45824 * tfactors.T9 + -0.950294 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 22.187684706656967 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 25.5338 * tfactors.T923i + + 6.45824 + (5.0/3.0) * -0.950294 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10n + ln_set_rate = 32.27223526553037 + -21.654753706656965 * tfactors.T9i + -30.9147 * tfactors.T913i + -1.2345 * tfactors.T913 + + 22.5118 * tfactors.T9 + -33.0589 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 21.654753706656965 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -30.9147 * tfactors.T943i + (1.0/3.0) * -1.2345 * tfactors.T923i + + 22.5118 + (5.0/3.0) * -33.0589 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + + // ReacLib set derived from il10r + ln_set_rate = 2.4434452655303747 + -27.664513706656965 * tfactors.T9i + 5.33756 * tfactors.T913 + + 1.64418 * tfactors.T9 + -0.246167 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 27.664513706656965 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.33756 * tfactors.T923i + + 1.64418 + (5.0/3.0) * -0.246167 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_S33_to_He4_P30_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // S33 + p --> He4 + P30 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real S33_log_pf, dS33_log_pf_dT9; + + // interpolating S33 partition function + get_partition_function_cached(S33, tfactors.T9, pf_cache, S33_log_pf, dS33_log_pf_dT9); + + amrex::Real P30_log_pf, dP30_log_pf_dT9; + + // interpolating P30 partition function + get_partition_function_cached(P30, tfactors.T9, pf_cache, P30_log_pf, dP30_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + P30_log_pf - p_log_pf - S33_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dP30_log_pf_dT9 - dp_log_pf_dT9 - dS33_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 50.751142362216704 + -17.649811835453008 * tfactors.T9i + -62.4643 * tfactors.T913i + 0.492934 * tfactors.T913 + + -0.841855 * tfactors.T9 + 0.059263 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 17.649811835453008 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -62.4643 * tfactors.T943i + (1.0/3.0) * 0.492934 * tfactors.T923i + + -0.841855 + (5.0/3.0) * 0.059263 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ar36_to_p_K39_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ar36 + He4 --> p + K39 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real K39_log_pf, dK39_log_pf_dT9; + + // interpolating K39 partition function + get_partition_function_cached(K39, tfactors.T9, pf_cache, K39_log_pf, dK39_log_pf_dT9); + + amrex::Real Ar36_log_pf, dAr36_log_pf_dT9; + + // interpolating Ar36 partition function + get_partition_function_cached(Ar36, tfactors.T9, pf_cache, Ar36_log_pf, dAr36_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + K39_log_pf - He4_log_pf - Ar36_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dK39_log_pf_dT9 - dHe4_log_pf_dT9 - dAr36_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 20.654451232729432 + -14.951286608188834 * tfactors.T9i + -30.0732 * tfactors.T913i + 7.03263 * tfactors.T913 + + -1.10085 * tfactors.T9 + 0.133768 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 14.951286608188834 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -30.0732 * tfactors.T943i + (1.0/3.0) * 7.03263 * tfactors.T923i + + -1.10085 + (5.0/3.0) * 0.133768 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ar37_to_He4_Cl34_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ar37 + p --> He4 + Cl34 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Cl34_log_pf, dCl34_log_pf_dT9; + + // interpolating Cl34 partition function + get_partition_function_cached(Cl34, tfactors.T9, pf_cache, Cl34_log_pf, dCl34_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ar37_log_pf, dAr37_log_pf_dT9; + + // interpolating Ar37 partition function + get_partition_function_cached(Ar37, tfactors.T9, pf_cache, Ar37_log_pf, dAr37_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Cl34_log_pf - p_log_pf - Ar37_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCl34_log_pf_dT9 - dp_log_pf_dT9 - dAr37_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 52.65061986402699 + -19.07242943961376 * tfactors.T9i + -68.2165 * tfactors.T913i + 0.330057 * tfactors.T913 + + -0.873334 * tfactors.T9 + 0.0592127 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 19.07242943961376 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -68.2165 * tfactors.T943i + (1.0/3.0) * 0.330057 * tfactors.T923i + + -0.873334 + (5.0/3.0) * 0.0592127 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ca40_to_p_Sc43_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ca40 + He4 --> p + Sc43 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca40_log_pf, dCa40_log_pf_dT9; + + // interpolating Ca40 partition function + get_partition_function_cached(Ca40, tfactors.T9, pf_cache, Ca40_log_pf, dCa40_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Sc43_log_pf, dSc43_log_pf_dT9; + + // interpolating Sc43 partition function + get_partition_function_cached(Sc43, tfactors.T9, pf_cache, Sc43_log_pf, dSc43_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Sc43_log_pf - He4_log_pf - Ca40_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dSc43_log_pf_dT9 - dHe4_log_pf_dT9 - dCa40_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 35.67546755788414 + -40.87525788838128 * tfactors.T9i + -32.1734 * tfactors.T913i + 0.0296879 * tfactors.T913 + + -0.95232 * tfactors.T9 + 0.129022 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 40.87525788838128 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * 0.0296879 * tfactors.T923i + + -0.95232 + (5.0/3.0) * 0.129022 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ca41_to_He4_K38_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ca41 + p --> He4 + K38 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ca41_log_pf, dCa41_log_pf_dT9; + + // interpolating Ca41 partition function + get_partition_function_cached(Ca41, tfactors.T9, pf_cache, Ca41_log_pf, dCa41_log_pf_dT9); + + amrex::Real K38_log_pf, dK38_log_pf_dT9; + + // interpolating K38 partition function + get_partition_function_cached(K38, tfactors.T9, pf_cache, K38_log_pf, dK38_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + K38_log_pf - p_log_pf - Ca41_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dK38_log_pf_dT9 - dp_log_pf_dT9 - dCa41_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 55.541590396195424 + -17.09455537095993 * tfactors.T9i + -73.7407 * tfactors.T913i + 0.600725 * tfactors.T913 + + -0.957475 * tfactors.T9 + 0.0689286 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 17.09455537095993 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -73.7407 * tfactors.T943i + (1.0/3.0) * 0.600725 * tfactors.T923i + + -0.957475 + (5.0/3.0) * 0.0689286 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ti45_to_He4_Sc42_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ti45 + p --> He4 + Sc42 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Sc42_log_pf, dSc42_log_pf_dT9; + + // interpolating Sc42 partition function + get_partition_function_cached(Sc42, tfactors.T9, pf_cache, Sc42_log_pf, dSc42_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ti45_log_pf, dTi45_log_pf_dT9; + + // interpolating Ti45 partition function + get_partition_function_cached(Ti45, tfactors.T9, pf_cache, Ti45_log_pf, dTi45_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Sc42_log_pf - p_log_pf - Ti45_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dSc42_log_pf_dT9 - dp_log_pf_dT9 - dTi45_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 56.88137786781152 + -23.50199005180725 * tfactors.T9i + -79.0687 * tfactors.T913i + -0.981235 * tfactors.T913 + + -0.48951 * tfactors.T9 + 0.0114272 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 23.50199005180725 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -79.0687 * tfactors.T943i + (1.0/3.0) * -0.981235 * tfactors.T923i + + -0.48951 + (5.0/3.0) * 0.0114272 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_V47_to_He4_Ti44_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // V47 + p --> He4 + Ti44 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real V47_log_pf, dV47_log_pf_dT9; + + // interpolating V47 partition function + get_partition_function_cached(V47, tfactors.T9, pf_cache, V47_log_pf, dV47_log_pf_dT9); + + amrex::Real Ti44_log_pf, dTi44_log_pf_dT9; + + // interpolating Ti44 partition function + get_partition_function_cached(Ti44, tfactors.T9, pf_cache, Ti44_log_pf, dTi44_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ti44_log_pf - p_log_pf - V47_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dTi44_log_pf_dT9 - dp_log_pf_dT9 - dV47_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from chw0r + ln_set_rate = -76.63208838152472 + -6.086479266444236 * tfactors.T9i + 70.2835 * tfactors.T913 + + -7.99061 * tfactors.T9 + 0.486213 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 6.086479266444236 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 70.2835 * tfactors.T923i + + -7.99061 + (5.0/3.0) * 0.486213 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Cr49_to_He4_V46_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cr49 + p --> He4 + V46 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real V46_log_pf, dV46_log_pf_dT9; + + // interpolating V46 partition function + get_partition_function_cached(V46, tfactors.T9, pf_cache, V46_log_pf, dV46_log_pf_dT9); + + amrex::Real Cr49_log_pf, dCr49_log_pf_dT9; + + // interpolating Cr49 partition function + get_partition_function_cached(Cr49, tfactors.T9, pf_cache, Cr49_log_pf, dCr49_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + V46_log_pf - p_log_pf - Cr49_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dV46_log_pf_dT9 - dp_log_pf_dT9 - dCr49_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 59.280226694242224 + -39.36768722760379 * tfactors.T9i + -84.2255 * tfactors.T913i + -1.09776 * tfactors.T913 + + -0.495216 * tfactors.T9 + 0.0124719 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 39.36768722760379 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -84.2255 * tfactors.T943i + (1.0/3.0) * -1.09776 * tfactors.T923i + + -0.495216 + (5.0/3.0) * 0.0124719 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Mn51_to_He4_Cr48_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn51 + p --> He4 + Cr48 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Cr48_log_pf, dCr48_log_pf_dT9; + + // interpolating Cr48 partition function + get_partition_function_cached(Cr48, tfactors.T9, pf_cache, Cr48_log_pf, dCr48_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn51_log_pf, dMn51_log_pf_dT9; + + // interpolating Mn51 partition function + get_partition_function_cached(Mn51, tfactors.T9, pf_cache, Mn51_log_pf, dMn51_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Cr48_log_pf - p_log_pf - Mn51_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCr48_log_pf_dT9 - dp_log_pf_dT9 - dMn51_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 58.71348267023461 + -6.47700151570639 * tfactors.T9i + -86.7459 * tfactors.T913i + 1.05653 * tfactors.T913 + + -1.15757 * tfactors.T9 + 0.0877546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 6.47700151570639 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * 1.05653 * tfactors.T923i + + -1.15757 + (5.0/3.0) * 0.0877546 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Mn52_to_He4_Cr49_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn52 + p --> He4 + Cr49 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn52_log_pf, dMn52_log_pf_dT9; + + // interpolating Mn52 partition function + get_partition_function_cached(Mn52, tfactors.T9, pf_cache, Mn52_log_pf, dMn52_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Cr49_log_pf, dCr49_log_pf_dT9; + + // interpolating Cr49 partition function + get_partition_function_cached(Cr49, tfactors.T9, pf_cache, Cr49_log_pf, dCr49_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Cr49_log_pf - p_log_pf - Mn52_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCr49_log_pf_dT9 - dp_log_pf_dT9 - dMn52_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 53.01374392177941 + -5.975570287637617 * tfactors.T9i + -86.7913 * tfactors.T913i + 10.6892 * tfactors.T913 + + -4.01586 * tfactors.T9 + 0.411275 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 5.975570287637617 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -86.7913 * tfactors.T943i + (1.0/3.0) * 10.6892 * tfactors.T923i + + -4.01586 + (5.0/3.0) * 0.411275 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co55 + p --> He4 + Fe52 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real Fe52_log_pf, dFe52_log_pf_dT9; + + // interpolating Fe52 partition function + get_partition_function_cached(Fe52, tfactors.T9, pf_cache, Fe52_log_pf, dFe52_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Fe52_log_pf - p_log_pf - Co55_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dFe52_log_pf_dT9 - dp_log_pf_dT9 - dCo55_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 61.42570080881217 + -9.676367161770125 * tfactors.T9i + -91.6819 * tfactors.T913i + -0.329235 * tfactors.T913 + + -0.780924 * tfactors.T9 + 0.0425179 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 9.676367161770125 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -0.329235 * tfactors.T923i + + -0.780924 + (5.0/3.0) * 0.0425179 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mn51_to_n_Mn50_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn51 --> n + Mn50 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn50_log_pf, dMn50_log_pf_dT9; + + // interpolating Mn50 partition function + get_partition_function_cached(Mn50, tfactors.T9, pf_cache, Mn50_log_pf, dMn50_log_pf_dT9); + + amrex::Real Mn51_log_pf, dMn51_log_pf_dT9; + + // interpolating Mn51 partition function + get_partition_function_cached(Mn51, tfactors.T9, pf_cache, Mn51_log_pf, dMn51_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Mn50_log_pf - Mn51_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dMn50_log_pf_dT9 - dMn51_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 37.34951332478154 + -158.83832832749732 * tfactors.T9i + -0.538879 * tfactors.T913 + + 0.284528 * tfactors.T9 + -0.0459849 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 158.83832832749732 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.538879 * tfactors.T923i + + 0.284528 + (5.0/3.0) * -0.0459849 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Mn52_to_n_Mn51_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn52 --> n + Mn51 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn51_log_pf, dMn51_log_pf_dT9; + + // interpolating Mn51 partition function + get_partition_function_cached(Mn51, tfactors.T9, pf_cache, Mn51_log_pf, dMn51_log_pf_dT9); + + amrex::Real Mn52_log_pf, dMn52_log_pf_dT9; + + // interpolating Mn52 partition function + get_partition_function_cached(Mn52, tfactors.T9, pf_cache, Mn52_log_pf, dMn52_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Mn51_log_pf - Mn52_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dMn51_log_pf_dT9 - dMn52_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 40.130587431823315 + -122.30591273875024 * tfactors.T9i + -1.83611 * tfactors.T913 + + 0.460384 * tfactors.T9 + -0.0584947 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 122.30591273875024 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.83611 * tfactors.T923i + + 0.460384 + (5.0/3.0) * -0.0584947 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Fe53_to_n_Fe52_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe53 --> n + Fe52 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe52_log_pf, dFe52_log_pf_dT9; + + // interpolating Fe52 partition function + get_partition_function_cached(Fe52, tfactors.T9, pf_cache, Fe52_log_pf, dFe52_log_pf_dT9); + + amrex::Real Fe53_log_pf, dFe53_log_pf_dT9; + + // interpolating Fe53 partition function + get_partition_function_cached(Fe53, tfactors.T9, pf_cache, Fe53_log_pf, dFe53_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Fe52_log_pf - Fe53_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dFe52_log_pf_dT9 - dFe53_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 37.50789742709652 + -124.01421385132892 * tfactors.T9i + -0.344319 * tfactors.T913 + + 0.178277 * tfactors.T9 + -0.0334326 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 124.01421385132892 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.344319 * tfactors.T923i + + 0.178277 + (5.0/3.0) * -0.0334326 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Fe53_to_p_Mn52_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe53 --> p + Mn52 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn52_log_pf, dMn52_log_pf_dT9; + + // interpolating Mn52 partition function + get_partition_function_cached(Mn52, tfactors.T9, pf_cache, Mn52_log_pf, dMn52_log_pf_dT9); + + amrex::Real Fe53_log_pf, dFe53_log_pf_dT9; + + // interpolating Fe53 partition function + get_partition_function_cached(Fe53, tfactors.T9, pf_cache, Fe53_log_pf, dFe53_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Mn52_log_pf - Fe53_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dMn52_log_pf_dT9 - dFe53_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 59.6140413175536 + -87.32493957326004 * tfactors.T9i + -36.187 * tfactors.T913i + 1.79171 * tfactors.T913 + + -1.77786 * tfactors.T9 + 0.179936 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 87.32493957326004 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.187 * tfactors.T943i + (1.0/3.0) * 1.79171 * tfactors.T923i + + -1.77786 + (5.0/3.0) * 0.179936 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Fe54_to_n_Fe53_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe54 --> n + Fe53 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe53_log_pf, dFe53_log_pf_dT9; + + // interpolating Fe53 partition function + get_partition_function_cached(Fe53, tfactors.T9, pf_cache, Fe53_log_pf, dFe53_log_pf_dT9); + + amrex::Real Fe54_log_pf, dFe54_log_pf_dT9; + + // interpolating Fe54 partition function + get_partition_function_cached(Fe54, tfactors.T9, pf_cache, Fe54_log_pf, dFe54_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Fe53_log_pf - Fe54_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dFe53_log_pf_dT9 - dFe54_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 42.23234536763494 + -155.25009527915816 * tfactors.T9i + -1.10421 * tfactors.T913 + + 0.379905 * tfactors.T9 + -0.0581878 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 155.25009527915816 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.10421 * tfactors.T923i + + 0.379905 + (5.0/3.0) * -0.0581878 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Fe55_to_n_Fe54_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe55 --> n + Fe54 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe55_log_pf, dFe55_log_pf_dT9; + + // interpolating Fe55 partition function + get_partition_function_cached(Fe55, tfactors.T9, pf_cache, Fe55_log_pf, dFe55_log_pf_dT9); + + amrex::Real Fe54_log_pf, dFe54_log_pf_dT9; + + // interpolating Fe54 partition function + get_partition_function_cached(Fe54, tfactors.T9, pf_cache, Fe54_log_pf, dFe54_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Fe54_log_pf - Fe55_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dFe54_log_pf_dT9 - dFe55_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ks03 + ln_set_rate = 21.50487677145662 + -107.84100838776591 * tfactors.T9i + -8.66617 * tfactors.T913i + 26.4472 * tfactors.T913 + + -1.9222 * tfactors.T9 + 0.0986404 * tfactors.T953 + -8.28317 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 107.84100838776591 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -8.66617 * tfactors.T943i + (1.0/3.0) * 26.4472 * tfactors.T923i + + -1.9222 + (5.0/3.0) * 0.0986404 * tfactors.T923 + -8.28317 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Fe56_to_n_Fe55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe56 --> n + Fe55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe56_log_pf, dFe56_log_pf_dT9; + + // interpolating Fe56 partition function + get_partition_function_cached(Fe56, tfactors.T9, pf_cache, Fe56_log_pf, dFe56_log_pf_dT9); + + amrex::Real Fe55_log_pf, dFe55_log_pf_dT9; + + // interpolating Fe55 partition function + get_partition_function_cached(Fe55, tfactors.T9, pf_cache, Fe55_log_pf, dFe55_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Fe55_log_pf - Fe56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dFe55_log_pf_dT9 - dFe56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ks03 + ln_set_rate = 46.806892234523204 + -130.0322634199283 * tfactors.T9i + 8.06062 * tfactors.T913i + -14.4809 * tfactors.T913 + + 0.94252 * tfactors.T9 + -0.0776007 * tfactors.T953 + 7.97093 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 130.0322634199283 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 8.06062 * tfactors.T943i + (1.0/3.0) * -14.4809 * tfactors.T923i + + 0.94252 + (5.0/3.0) * -0.0776007 * tfactors.T923 + 7.97093 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Co55_to_p_Fe54_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co55 --> p + Fe54 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real Fe54_log_pf, dFe54_log_pf_dT9; + + // interpolating Fe54 partition function + get_partition_function_cached(Fe54, tfactors.T9, pf_cache, Fe54_log_pf, dFe54_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Fe54_log_pf - Co55_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dFe54_log_pf_dT9 - dCo55_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 57.84851844810452 + -58.76958578644693 * tfactors.T9i + -37.1544 * tfactors.T913i + 0.950364 * tfactors.T913 + + -1.77529 * tfactors.T9 + 0.198562 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 58.76958578644693 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1544 * tfactors.T943i + (1.0/3.0) * 0.950364 * tfactors.T923i + + -1.77529 + (5.0/3.0) * 0.198562 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Co56_to_n_Co55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co56 --> n + Co55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Co55_log_pf - Co56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dCo55_log_pf_dT9 - dCo56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 40.647564333711024 + -116.994640839646 * tfactors.T9i + -1.86357 * tfactors.T913 + + 0.616591 * tfactors.T9 + -0.0839313 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 116.994640839646 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.86357 * tfactors.T923i + + 0.616591 + (5.0/3.0) * -0.0839313 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Co56_to_p_Fe55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co56 --> p + Fe55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Fe55_log_pf, dFe55_log_pf_dT9; + + // interpolating Fe55 partition function + get_partition_function_cached(Fe55, tfactors.T9, pf_cache, Fe55_log_pf, dFe55_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Fe55_log_pf - Co56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dFe55_log_pf_dT9 - dCo56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 58.620466010358925 + -67.86404663834863 * tfactors.T9i + -37.1585 * tfactors.T913i + 1.66198 * tfactors.T913 + + -1.60842 * tfactors.T9 + 0.148916 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 67.86404663834863 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1585 * tfactors.T943i + (1.0/3.0) * 1.66198 * tfactors.T923i + + -1.60842 + (5.0/3.0) * 0.148916 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Co56_to_He4_Mn52_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co56 --> He4 + Mn52 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn52_log_pf, dMn52_log_pf_dT9; + + // interpolating Mn52 partition function + get_partition_function_cached(Mn52, tfactors.T9, pf_cache, Mn52_log_pf, dMn52_log_pf_dT9); + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Mn52_log_pf - Co56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dMn52_log_pf_dT9 - dCo56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 88.91600903298027 + -89.98173372334725 * tfactors.T9i + -89.3157 * tfactors.T913i + -1.95982 * tfactors.T913 + + -2.45671 * tfactors.T9 + 0.296095 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 89.98173372334725 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.3157 * tfactors.T943i + (1.0/3.0) * -1.95982 * tfactors.T923i + + -2.45671 + (5.0/3.0) * 0.296095 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Co57_to_n_Co56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co57 --> n + Co56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real Co57_log_pf, dCo57_log_pf_dT9; + + // interpolating Co57 partition function + get_partition_function_cached(Co57, tfactors.T9, pf_cache, Co57_log_pf, dCo57_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Co56_log_pf - Co57_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dCo56_log_pf_dT9 - dCo57_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 41.17386809654295 + -132.01901045161702 * tfactors.T9i + -1.37855 * tfactors.T913 + + 0.299896 * tfactors.T9 + -0.04382 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 132.01901045161702 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.37855 * tfactors.T923i + + 0.299896 + (5.0/3.0) * -0.04382 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Co57_to_p_Fe56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co57 --> p + Fe56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe56_log_pf, dFe56_log_pf_dT9; + + // interpolating Fe56 partition function + get_partition_function_cached(Fe56, tfactors.T9, pf_cache, Fe56_log_pf, dFe56_log_pf_dT9); + + amrex::Real Co57_log_pf, dCo57_log_pf_dT9; + + // interpolating Co57 partition function + get_partition_function_cached(Co57, tfactors.T9, pf_cache, Co57_log_pf, dCo57_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Fe56_log_pf - Co57_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dFe56_log_pf_dT9 - dCo57_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 57.68564187237867 + -69.94636137001572 * tfactors.T9i + -37.1625 * tfactors.T913i + 1.06776 * tfactors.T913 + + -1.31689 * tfactors.T9 + 0.122089 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 69.94636137001572 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1625 * tfactors.T943i + (1.0/3.0) * 1.06776 * tfactors.T923i + + -1.31689 + (5.0/3.0) * 0.122089 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni57_to_n_Ni56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni57 --> n + Ni56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni56_log_pf, dNi56_log_pf_dT9; + + // interpolating Ni56 partition function + get_partition_function_cached(Ni56, tfactors.T9, pf_cache, Ni56_log_pf, dNi56_log_pf_dT9); + + amrex::Real Ni57_log_pf, dNi57_log_pf_dT9; + + // interpolating Ni57 partition function + get_partition_function_cached(Ni57, tfactors.T9, pf_cache, Ni57_log_pf, dNi57_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Ni56_log_pf - Ni57_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dNi56_log_pf_dT9 - dNi57_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 38.391039283996996 + -118.91983039605458 * tfactors.T9i + -1.19665 * tfactors.T913 + + 0.507179 * tfactors.T9 + -0.074604 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 118.91983039605458 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.19665 * tfactors.T923i + + 0.507179 + (5.0/3.0) * -0.074604 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni57_to_p_Co56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni57 --> p + Co56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ni57_log_pf, dNi57_log_pf_dT9; + + // interpolating Ni57 partition function + get_partition_function_cached(Ni57, tfactors.T9, pf_cache, Ni57_log_pf, dNi57_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Co56_log_pf - Ni57_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCo56_log_pf_dT9 - dNi57_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 60.10327899221158 + -85.08979333790236 * tfactors.T9i + -38.1094 * tfactors.T913i + 2.57091 * tfactors.T913 + + -2.07795 * tfactors.T9 + 0.20757 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 85.08979333790236 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1094 * tfactors.T943i + (1.0/3.0) * 2.57091 * tfactors.T923i + + -2.07795 + (5.0/3.0) * 0.20757 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni57_to_He4_Fe53_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni57 --> He4 + Fe53 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ni57_log_pf, dNi57_log_pf_dT9; + + // interpolating Ni57 partition function + get_partition_function_cached(Ni57, tfactors.T9, pf_cache, Ni57_log_pf, dNi57_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe53_log_pf, dFe53_log_pf_dT9; + + // interpolating Fe53 partition function + get_partition_function_cached(Fe53, tfactors.T9, pf_cache, Fe53_log_pf, dFe53_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Fe53_log_pf - Ni57_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dFe53_log_pf_dT9 - dNi57_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 94.74134670763823 + -87.74658748798956 * tfactors.T9i + -91.7231 * tfactors.T913i + -10.1816 * tfactors.T913 + + -0.0406303 * tfactors.T9 + 0.0345056 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 87.74658748798956 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * -10.1816 * tfactors.T923i + + -0.0406303 + (5.0/3.0) * 0.0345056 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni58_to_n_Ni57_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni58 --> n + Ni57 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni57_log_pf, dNi57_log_pf_dT9; + + // interpolating Ni57 partition function + get_partition_function_cached(Ni57, tfactors.T9, pf_cache, Ni57_log_pf, dNi57_log_pf_dT9); + + amrex::Real Ni58_log_pf, dNi58_log_pf_dT9; + + // interpolating Ni58 partition function + get_partition_function_cached(Ni58, tfactors.T9, pf_cache, Ni58_log_pf, dNi58_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Ni57_log_pf - Ni58_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dNi57_log_pf_dT9 - dNi58_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 42.36077897558323 + -141.76332431826057 * tfactors.T9i + -1.90814 * tfactors.T913 + + 0.493188 * tfactors.T9 + -0.0684633 * tfactors.T953 + 1.5 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 141.76332431826057 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.90814 * tfactors.T923i + + 0.493188 + (5.0/3.0) * -0.0684633 * tfactors.T923 + 1.5 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni58_to_p_Co57_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni58 --> p + Co57 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni58_log_pf, dNi58_log_pf_dT9; + + // interpolating Ni58 partition function + get_partition_function_cached(Ni58, tfactors.T9, pf_cache, Ni58_log_pf, dNi58_log_pf_dT9); + + amrex::Real Co57_log_pf, dCo57_log_pf_dT9; + + // interpolating Co57 partition function + get_partition_function_cached(Co57, tfactors.T9, pf_cache, Co57_log_pf, dCo57_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Co57_log_pf - Ni58_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCo57_log_pf_dT9 - dNi58_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 61.794489871251855 + -94.83410720454592 * tfactors.T9i + -38.1133 * tfactors.T913i + 1.77414 * tfactors.T913 + + -1.48268 * tfactors.T9 + 0.121073 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 94.83410720454592 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 1.77414 * tfactors.T923i + + -1.48268 + (5.0/3.0) * 0.121073 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Ni58_to_He4_Fe54_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni58 --> He4 + Fe54 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni58_log_pf, dNi58_log_pf_dT9; + + // interpolating Ni58 partition function + get_partition_function_cached(Ni58, tfactors.T9, pf_cache, Ni58_log_pf, dNi58_log_pf_dT9); + + amrex::Real Fe54_log_pf, dFe54_log_pf_dT9; + + // interpolating Fe54 partition function + get_partition_function_cached(Fe54, tfactors.T9, pf_cache, Fe54_log_pf, dFe54_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Fe54_log_pf - Ni58_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dFe54_log_pf_dT9 - dNi58_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 85.23428031558652 + -74.25981652709197 * tfactors.T9i + -91.7628 * tfactors.T913i + 4.23027 * tfactors.T913 + + -3.31305 * tfactors.T9 + 0.271293 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 74.25981652709197 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7628 * tfactors.T943i + (1.0/3.0) * 4.23027 * tfactors.T923i + + -3.31305 + (5.0/3.0) * 0.271293 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cu59_to_p_Ni58_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cu59 --> p + Ni58 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cu59_log_pf, dCu59_log_pf_dT9; + + // interpolating Cu59 partition function + get_partition_function_cached(Cu59, tfactors.T9, pf_cache, Cu59_log_pf, dCu59_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni58_log_pf, dNi58_log_pf_dT9; + + // interpolating Ni58 partition function + get_partition_function_cached(Ni58, tfactors.T9, pf_cache, Ni58_log_pf, dNi58_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Ni58_log_pf - Cu59_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dNi58_log_pf_dT9 - dCu59_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from si13n + ln_set_rate = 58.97928371193912 + -39.67086986195644 * tfactors.T9i + -39.0526 * tfactors.T913i + 1.0436 * tfactors.T913 + + -2.10834 * tfactors.T9 + 0.239559 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 39.67086986195644 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.0526 * tfactors.T943i + (1.0/3.0) * 1.0436 * tfactors.T923i + + -2.10834 + (5.0/3.0) * 0.239559 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Cu59_to_He4_Co55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Cu59 --> He4 + Co55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cu59_log_pf, dCu59_log_pf_dT9; + + // interpolating Cu59 partition function + get_partition_function_cached(Cu59, tfactors.T9, pf_cache, Cu59_log_pf, dCu59_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Co55_log_pf - Cu59_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCo55_log_pf_dT9 - dCu59_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 90.97354557942113 + -55.1611006026015 * tfactors.T9i + -94.1404 * tfactors.T913i + -2.62786 * tfactors.T913 + + -2.12066 * tfactors.T9 + 0.237999 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 55.1611006026015 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * -2.62786 * tfactors.T923i + + -2.12066 + (5.0/3.0) * 0.237999 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Zn60_to_p_Cu59_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Zn60 --> p + Cu59 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cu59_log_pf, dCu59_log_pf_dT9; + + // interpolating Cu59 partition function + get_partition_function_cached(Cu59, tfactors.T9, pf_cache, Cu59_log_pf, dCu59_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Zn60_log_pf, dZn60_log_pf_dT9; + + // interpolating Zn60 partition function + get_partition_function_cached(Zn60, tfactors.T9, pf_cache, Zn60_log_pf, dZn60_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Cu59_log_pf - Zn60_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCu59_log_pf_dT9 - dZn60_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 62.31218638341413 + -59.240729222177784 * tfactors.T9i + -39.9808 * tfactors.T913i + 1.17311 * tfactors.T913 + + -2.90486 * tfactors.T9 + 0.339644 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 59.240729222177784 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 1.17311 * tfactors.T923i + + -2.90486 + (5.0/3.0) * 0.339644 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_Zn60_to_He4_Ni56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Zn60 --> He4 + Ni56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Ni56_log_pf, dNi56_log_pf_dT9; + + // interpolating Ni56 partition function + get_partition_function_cached(Ni56, tfactors.T9, pf_cache, Ni56_log_pf, dNi56_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Zn60_log_pf, dZn60_log_pf_dT9; + + // interpolating Zn60 partition function + get_partition_function_cached(Zn60, tfactors.T9, pf_cache, Zn60_log_pf, dZn60_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Ni56_log_pf - Zn60_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dNi56_log_pf_dT9 - dZn60_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 86.06332792090964 + -31.2372260432927 * tfactors.T9i + -96.4898 * tfactors.T913i + 6.47209 * tfactors.T913 + + -5.2029 * tfactors.T9 + 0.533391 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 31.2372260432927 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -96.4898 * tfactors.T943i + (1.0/3.0) * 6.47209 * tfactors.T923i + + -5.2029 + (5.0/3.0) * 0.533391 * tfactors.T923 + 0.833333 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Mn52_to_n_Fe52_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn52 + p --> n + Fe52 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn52_log_pf, dMn52_log_pf_dT9; + + // interpolating Mn52 partition function + get_partition_function_cached(Mn52, tfactors.T9, pf_cache, Mn52_log_pf, dMn52_log_pf_dT9); + + amrex::Real Fe52_log_pf, dFe52_log_pf_dT9; + + // interpolating Fe52 partition function + get_partition_function_cached(Fe52, tfactors.T9, pf_cache, Fe52_log_pf, dFe52_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Fe52_log_pf - p_log_pf - Mn52_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dFe52_log_pf_dT9 - dp_log_pf_dT9 - dMn52_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 15.385756109542921 + -36.68927427806889 * tfactors.T9i + 0.569856 * tfactors.T913 + + 0.390117 * tfactors.T9 + -0.0479043 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 36.68927427806889 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 0.569856 * tfactors.T923i + + 0.390117 + (5.0/3.0) * -0.0479043 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mn52_to_n_Co55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Mn52 + He4 --> n + Co55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn52_log_pf, dMn52_log_pf_dT9; + + // interpolating Mn52 partition function + get_partition_function_cached(Mn52, tfactors.T9, pf_cache, Mn52_log_pf, dMn52_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Co55_log_pf - He4_log_pf - Mn52_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dCo55_log_pf_dT9 - dHe4_log_pf_dT9 - dMn52_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = -14.314644699269245 + -27.01290711629877 * tfactors.T9i + 8.15876 * tfactors.T913 + + 3.05978 * tfactors.T9 + -0.406535 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 27.01290711629877 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.15876 * tfactors.T923i + + 3.05978 + (5.0/3.0) * -0.406535 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe53_to_He4_Mn50_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe53 + p --> He4 + Mn50 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Mn50_log_pf, dMn50_log_pf_dT9; + + // interpolating Mn50 partition function + get_partition_function_cached(Mn50, tfactors.T9, pf_cache, Mn50_log_pf, dMn50_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe53_log_pf, dFe53_log_pf_dT9; + + // interpolating Fe53 partition function + get_partition_function_cached(Fe53, tfactors.T9, pf_cache, Fe53_log_pf, dFe53_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = He4_log_pf + Mn50_log_pf - p_log_pf - Fe53_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dMn50_log_pf_dT9 - dp_log_pf_dT9 - dFe53_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 61.873981640134645 + -40.111652884372496 * tfactors.T9i + -89.2309 * tfactors.T913i + -1.4758 * tfactors.T913 + + -0.437831 * tfactors.T9 + -0.00354594 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 40.111652884372496 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.2309 * tfactors.T943i + (1.0/3.0) * -1.4758 * tfactors.T923i + + -0.437831 + (5.0/3.0) * -0.00354594 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe53_to_n_Ni56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe53 + He4 --> n + Ni56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni56_log_pf, dNi56_log_pf_dT9; + + // interpolating Ni56 partition function + get_partition_function_cached(Ni56, tfactors.T9, pf_cache, Ni56_log_pf, dNi56_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe53_log_pf, dFe53_log_pf_dT9; + + // interpolating Fe53 partition function + get_partition_function_cached(Fe53, tfactors.T9, pf_cache, Fe53_log_pf, dFe53_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Ni56_log_pf - He4_log_pf - Fe53_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dNi56_log_pf_dT9 - dHe4_log_pf_dT9 - dFe53_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = -11.207137423641244 + -31.17324290806502 * tfactors.T9i + 6.43259 * tfactors.T913 + + 2.29591 * tfactors.T9 + -0.254724 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 31.17324290806502 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 6.43259 * tfactors.T923i + + 2.29591 + (5.0/3.0) * -0.254724 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe54_to_He4_Mn51_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe54 + p --> He4 + Mn51 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn51_log_pf, dMn51_log_pf_dT9; + + // interpolating Mn51 partition function + get_partition_function_cached(Mn51, tfactors.T9, pf_cache, Mn51_log_pf, dMn51_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe54_log_pf, dFe54_log_pf_dT9; + + // interpolating Fe54 partition function + get_partition_function_cached(Fe54, tfactors.T9, pf_cache, Fe54_log_pf, dFe54_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Mn51_log_pf - p_log_pf - Fe54_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dMn51_log_pf_dT9 - dp_log_pf_dT9 - dFe54_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 65.35241368298804 + -36.52341983603332 * tfactors.T9i + -89.274 * tfactors.T913i + -0.862452 * tfactors.T913 + + -0.635672 * tfactors.T9 + 0.0196464 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 36.52341983603332 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -0.862452 * tfactors.T923i + + -0.635672 + (5.0/3.0) * 0.0196464 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe54_to_n_Ni57_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe54 + He4 --> n + Ni57 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni57_log_pf, dNi57_log_pf_dT9; + + // interpolating Ni57 partition function + get_partition_function_cached(Ni57, tfactors.T9, pf_cache, Ni57_log_pf, dNi57_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe54_log_pf, dFe54_log_pf_dT9; + + // interpolating Fe54 partition function + get_partition_function_cached(Fe54, tfactors.T9, pf_cache, Fe54_log_pf, dFe54_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Ni57_log_pf - He4_log_pf - Fe54_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dNi57_log_pf_dT9 - dHe4_log_pf_dT9 - dFe54_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 14.633898659996703 + -67.50350779116859 * tfactors.T9i + 0.48562 * tfactors.T913 + + -0.0249302 * tfactors.T9 + 0.0509605 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 67.50350779116859 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 0.48562 * tfactors.T923i + + -0.0249302 + (5.0/3.0) * 0.0509605 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe54_to_p_Co57_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe54 + He4 --> p + Co57 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Co57_log_pf, dCo57_log_pf_dT9; + + // interpolating Co57 partition function + get_partition_function_cached(Co57, tfactors.T9, pf_cache, Co57_log_pf, dCo57_log_pf_dT9); + + amrex::Real Fe54_log_pf, dFe54_log_pf_dT9; + + // interpolating Fe54 partition function + get_partition_function_cached(Fe54, tfactors.T9, pf_cache, Fe54_log_pf, dFe54_log_pf_dT9); + + amrex::Real net_log_pf = p_log_pf + Co57_log_pf - He4_log_pf - Fe54_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCo57_log_pf_dT9 - dHe4_log_pf_dT9 - dFe54_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = -1.404090444334669 + -20.574290677453938 * tfactors.T9i + -38.1133 * tfactors.T913i + 29.3541 * tfactors.T913 + + -4.75966 * tfactors.T9 + 0.40418 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 20.574290677453938 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 29.3541 * tfactors.T923i + + -4.75966 + (5.0/3.0) * 0.40418 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe55_to_n_Co55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe55 + p --> n + Co55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real Fe55_log_pf, dFe55_log_pf_dT9; + + // interpolating Fe55 partition function + get_partition_function_cached(Fe55, tfactors.T9, pf_cache, Fe55_log_pf, dFe55_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Co55_log_pf - p_log_pf - Fe55_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dCo55_log_pf_dT9 - dp_log_pf_dT9 - dFe55_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 21.4351983233521 + -49.13059420131897 * tfactors.T9i + -1.62382 * tfactors.T913 + + 0.58115 * tfactors.T9 + -0.0537057 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 49.13059420131897 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.62382 * tfactors.T923i + + 0.58115 + (5.0/3.0) * -0.0537057 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe55_to_He4_Mn52_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe55 + p --> He4 + Mn52 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Mn52_log_pf, dMn52_log_pf_dT9; + + // interpolating Mn52 partition function + get_partition_function_cached(Mn52, tfactors.T9, pf_cache, Mn52_log_pf, dMn52_log_pf_dT9); + + amrex::Real Fe55_log_pf, dFe55_log_pf_dT9; + + // interpolating Fe55 partition function + get_partition_function_cached(Fe55, tfactors.T9, pf_cache, Fe55_log_pf, dFe55_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Mn52_log_pf - p_log_pf - Fe55_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dMn52_log_pf_dT9 - dp_log_pf_dT9 - dFe55_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 59.132043022621346 + -22.1176870850202 * tfactors.T9i + -89.3157 * tfactors.T913i + 5.65639 * tfactors.T913 + + -2.28952 * tfactors.T9 + 0.186017 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 22.1176870850202 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.3157 * tfactors.T943i + (1.0/3.0) * 5.65639 * tfactors.T923i + + -2.28952 + (5.0/3.0) * 0.186017 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe55_to_n_Ni58_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe55 + He4 --> n + Ni58 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni58_log_pf, dNi58_log_pf_dT9; + + // interpolating Ni58 partition function + get_partition_function_cached(Ni58, tfactors.T9, pf_cache, Ni58_log_pf, dNi58_log_pf_dT9); + + amrex::Real Fe55_log_pf, dFe55_log_pf_dT9; + + // interpolating Fe55 partition function + get_partition_function_cached(Fe55, tfactors.T9, pf_cache, Fe55_log_pf, dFe55_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Ni58_log_pf - He4_log_pf - Fe55_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dNi58_log_pf_dT9 - dHe4_log_pf_dT9 - dFe55_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = -4.711973544129908 + -33.64036346067392 * tfactors.T9i + 3.44996 * tfactors.T913 + + 2.98226 * tfactors.T9 + -0.387699 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 33.64036346067392 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 3.44996 * tfactors.T923i + + 2.98226 + (5.0/3.0) * -0.387699 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe56_to_n_Co56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Fe56 + p --> n + Co56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe56_log_pf, dFe56_log_pf_dT9; + + // interpolating Fe56 partition function + get_partition_function_cached(Fe56, tfactors.T9, pf_cache, Fe56_log_pf, dFe56_log_pf_dT9); + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Co56_log_pf - p_log_pf - Fe56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dCo56_log_pf_dT9 - dp_log_pf_dT9 - dFe56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 22.653426224164285 + -62.07264908160129 * tfactors.T9i + -1.13331 * tfactors.T913 + + 0.347185 * tfactors.T9 + -0.0328879 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 62.07264908160129 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.13331 * tfactors.T923i + + 0.347185 + (5.0/3.0) * -0.0328879 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co56_to_n_Ni56_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co56 + p --> n + Ni56 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni56_log_pf, dNi56_log_pf_dT9; + + // interpolating Ni56 partition function + get_partition_function_cached(Ni56, tfactors.T9, pf_cache, Ni56_log_pf, dNi56_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Ni56_log_pf - p_log_pf - Co56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dNi56_log_pf_dT9 - dp_log_pf_dT9 - dCo56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 13.374260291785419 + -33.830037058152215 * tfactors.T9i + 1.76846 * tfactors.T913 + + 0.197992 * tfactors.T9 + -0.017494 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 33.830037058152215 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 1.76846 * tfactors.T923i + + 0.197992 + (5.0/3.0) * -0.017494 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co56_to_He4_Fe53_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co56 + p --> He4 + Fe53 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Fe53_log_pf, dFe53_log_pf_dT9; + + // interpolating Fe53 partition function + get_partition_function_cached(Fe53, tfactors.T9, pf_cache, Fe53_log_pf, dFe53_log_pf_dT9); + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Fe53_log_pf - p_log_pf - Co56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dFe53_log_pf_dT9 - dp_log_pf_dT9 - dCo56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 56.029567715426666 + -2.6567941500871917 * tfactors.T9i + -91.7231 * tfactors.T913i + 10.052 * tfactors.T913 + + -3.86332 * tfactors.T9 + 0.391105 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 2.6567941500871917 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * 10.052 * tfactors.T923i + + -3.86332 + (5.0/3.0) * 0.391105 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Co56_to_n_Cu59_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co56 + He4 --> n + Cu59 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Cu59_log_pf, dCu59_log_pf_dT9; + + // interpolating Cu59 partition function + get_partition_function_cached(Cu59, tfactors.T9, pf_cache, Cu59_log_pf, dCu59_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Co56_log_pf, dCo56_log_pf_dT9; + + // interpolating Co56 partition function + get_partition_function_cached(Co56, tfactors.T9, pf_cache, Co56_log_pf, dCo56_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Cu59_log_pf - He4_log_pf - Co56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dCu59_log_pf_dT9 - dHe4_log_pf_dT9 - dCo56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 8.911918754289905 + -61.8335402370445 * tfactors.T9i + -1.00882 * tfactors.T913 + + 1.88993 * tfactors.T9 + -0.202319 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 61.8335402370445 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.00882 * tfactors.T923i + + 1.88993 + (5.0/3.0) * -0.202319 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co57_to_n_Ni57_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Co57 + p --> n + Ni57 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni57_log_pf, dNi57_log_pf_dT9; + + // interpolating Ni57 partition function + get_partition_function_cached(Ni57, tfactors.T9, pf_cache, Ni57_log_pf, dNi57_log_pf_dT9); + + amrex::Real Co57_log_pf, dCo57_log_pf_dT9; + + // interpolating Co57 partition function + get_partition_function_cached(Co57, tfactors.T9, pf_cache, Co57_log_pf, dCo57_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = n_log_pf + Ni57_log_pf - p_log_pf - Co57_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dNi57_log_pf_dT9 - dp_log_pf_dT9 - dCo57_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 19.30298910433137 + -46.92921711371466 * tfactors.T9i + -1.13177 * tfactors.T913 + + 0.56875 * tfactors.T9 + -0.0579913 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 46.92921711371466 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.13177 * tfactors.T923i + + 0.56875 + (5.0/3.0) * -0.0579913 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ni56_to_p_Cu59_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni56 + He4 --> p + Cu59 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real Cu59_log_pf, dCu59_log_pf_dT9; + + // interpolating Cu59 partition function + get_partition_function_cached(Cu59, tfactors.T9, pf_cache, Cu59_log_pf, dCu59_log_pf_dT9); + + amrex::Real Ni56_log_pf, dNi56_log_pf_dT9; + + // interpolating Ni56 partition function + get_partition_function_cached(Ni56, tfactors.T9, pf_cache, Ni56_log_pf, dNi56_log_pf_dT9); + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real net_log_pf = p_log_pf + Cu59_log_pf - He4_log_pf - Ni56_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dp_log_pf_dT9 + dCu59_log_pf_dT9 - dHe4_log_pf_dT9 - dNi56_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 20.864958462504486 + -28.003503178913892 * tfactors.T9i + -39.9808 * tfactors.T913i + 13.6773 * tfactors.T913 + + -3.76429 * tfactors.T9 + 0.438096 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 28.003503178913892 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 13.6773 * tfactors.T923i + + -3.76429 + (5.0/3.0) * 0.438096 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ni57_to_n_Zn60_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni57 + He4 --> n + Zn60 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real n_log_pf, dn_log_pf_dT9; + + // setting n log(partition function) to 0.0 by default, independent of T + n_log_pf = 0.0_rt; + dn_log_pf_dT9 = 0.0_rt; + + amrex::Real Ni57_log_pf, dNi57_log_pf_dT9; + + // interpolating Ni57 partition function + get_partition_function_cached(Ni57, tfactors.T9, pf_cache, Ni57_log_pf, dNi57_log_pf_dT9); + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Zn60_log_pf, dZn60_log_pf_dT9; + + // interpolating Zn60 partition function + get_partition_function_cached(Zn60, tfactors.T9, pf_cache, Zn60_log_pf, dZn60_log_pf_dT9); + + amrex::Real net_log_pf = n_log_pf + Zn60_log_pf - He4_log_pf - Ni57_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dn_log_pf_dT9 + dZn60_log_pf_dT9 - dHe4_log_pf_dT9 - dNi57_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 9.748611363087353 + -87.68260435279066 * tfactors.T9i + 5.43552 * tfactors.T913 + + -1.25169 * tfactors.T9 + 0.148383 * tfactors.T953; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 87.68260435279066 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.43552 * tfactors.T923i + + -1.25169 + (5.0/3.0) * 0.148383 * tfactors.T923; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ni58_to_He4_Co55_derived(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] const T& rate_eval, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { + + // Ni58 + p --> He4 + Co55 + + rate = 0.0; + drate_dT = 0.0; + + // Evaluate partition function terms + + amrex::Real p_log_pf, dp_log_pf_dT9; + + // setting p log(partition function) to 0.0 by default, independent of T + p_log_pf = 0.0_rt; + dp_log_pf_dT9 = 0.0_rt; + + amrex::Real He4_log_pf, dHe4_log_pf_dT9; + + // setting He4 log(partition function) to 0.0 by default, independent of T + He4_log_pf = 0.0_rt; + dHe4_log_pf_dT9 = 0.0_rt; + + amrex::Real Co55_log_pf, dCo55_log_pf_dT9; + + // interpolating Co55 partition function + get_partition_function_cached(Co55, tfactors.T9, pf_cache, Co55_log_pf, dCo55_log_pf_dT9); + + amrex::Real Ni58_log_pf, dNi58_log_pf_dT9; + + // interpolating Ni58 partition function + get_partition_function_cached(Ni58, tfactors.T9, pf_cache, Ni58_log_pf, dNi58_log_pf_dT9); + + amrex::Real net_log_pf = He4_log_pf + Co55_log_pf - p_log_pf - Ni58_log_pf; + [[maybe_unused]] amrex::Real net_dlog_pf_dT9 = dHe4_log_pf_dT9 + dCo55_log_pf_dT9 - dp_log_pf_dT9 - dNi58_log_pf_dT9; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ReacLib set derived from ths8r + ln_set_rate = 63.596461867482006 + -15.490230740645051 * tfactors.T9i + -94.1404 * tfactors.T913i + 3.39179 * tfactors.T913 + + -1.71062 * tfactors.T9 + 0.133003 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += net_log_pf + log_scor; + + if constexpr (std::is_same_v) { + dln_set_rate_dT9 = 15.490230740645051 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * 3.39179 * tfactors.T923i + + -1.71062 + (5.0/3.0) * 0.133003 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += net_dlog_pf_dT9 + dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (std::is_same_v) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9_rt; + } + +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void +fill_derived_rates(const tf_t& tfactors, T& rate_eval) +{ + + amrex::ignore_unused(tfactors); + amrex::ignore_unused(rate_eval); + + [[maybe_unused]] amrex::Real rate; + [[maybe_unused]] amrex::Real drate_dT; + + part_fun::pf_cache_t pf_cache{}; + + pf_cache.index_temp_array_1 = interp_net::find_index(tfactors.T9, part_fun::temp_array_1); + + { + // N13_to_p_C12_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_N13_to_p_C12_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_N13_to_p_C12_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_N13_to_p_C12_derived) = drate_dT; + } + } + + { + // N14_to_p_C13_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_N14_to_p_C13_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_N14_to_p_C13_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_N14_to_p_C13_derived) = drate_dT; + } + } + + { + // N15_to_p_C14_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_N15_to_p_C14_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_N15_to_p_C14_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_N15_to_p_C14_derived) = drate_dT; + } + } + + { + // O16_to_p_N15_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_O16_to_p_N15_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_O16_to_p_N15_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_O16_to_p_N15_derived) = drate_dT; + } + } + + { + // O16_to_He4_C12_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_O16_to_He4_C12_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_O16_to_He4_C12_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_O16_to_He4_C12_derived) = drate_dT; + } + } + + { + // O18_to_He4_C14_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_O18_to_He4_C14_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_O18_to_He4_C14_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_O18_to_He4_C14_derived) = drate_dT; + } + } + + { + // F18_to_p_O17_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_F18_to_p_O17_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_F18_to_p_O17_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_F18_to_p_O17_derived) = drate_dT; + } + } + + { + // F18_to_He4_N14_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_F18_to_He4_N14_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_F18_to_He4_N14_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_F18_to_He4_N14_derived) = drate_dT; + } + } + + { + // F19_to_p_O18_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_F19_to_p_O18_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_F19_to_p_O18_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_F19_to_p_O18_derived) = drate_dT; + } + } + + { + // F19_to_He4_N15_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_F19_to_He4_N15_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_F19_to_He4_N15_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_F19_to_He4_N15_derived) = drate_dT; + } + } + + { + // Ne20_to_p_F19_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ne20_to_p_F19_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ne20_to_p_F19_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ne20_to_p_F19_derived) = drate_dT; + } + } + + { + // Ne20_to_He4_O16_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ne20_to_He4_O16_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ne20_to_He4_O16_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ne20_to_He4_O16_derived) = drate_dT; + } + } + + { + // Ne21_to_He4_O17_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ne21_to_He4_O17_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ne21_to_He4_O17_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ne21_to_He4_O17_derived) = drate_dT; + } + } + + { + // Ne22_to_He4_O18_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ne22_to_He4_O18_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ne22_to_He4_O18_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ne22_to_He4_O18_derived) = drate_dT; + } + } + + { + // Na22_to_p_Ne21_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Na22_to_p_Ne21_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Na22_to_p_Ne21_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Na22_to_p_Ne21_derived) = drate_dT; + } + } + + { + // Na22_to_He4_F18_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Na22_to_He4_F18_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Na22_to_He4_F18_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Na22_to_He4_F18_derived) = drate_dT; + } + } + + { + // Na23_to_p_Ne22_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Na23_to_p_Ne22_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Na23_to_p_Ne22_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Na23_to_p_Ne22_derived) = drate_dT; + } + } + + { + // Na23_to_He4_F19_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Na23_to_He4_F19_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Na23_to_He4_F19_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Na23_to_He4_F19_derived) = drate_dT; + } + } + + { + // Mg24_to_p_Na23_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mg24_to_p_Na23_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mg24_to_p_Na23_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mg24_to_p_Na23_derived) = drate_dT; + } + } + + { + // Mg24_to_He4_Ne20_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mg24_to_He4_Ne20_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mg24_to_He4_Ne20_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mg24_to_He4_Ne20_derived) = drate_dT; + } + } + + { + // Mg25_to_He4_Ne21_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mg25_to_He4_Ne21_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mg25_to_He4_Ne21_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mg25_to_He4_Ne21_derived) = drate_dT; + } + } + + { + // Al26_to_p_Mg25_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Al26_to_p_Mg25_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Al26_to_p_Mg25_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Al26_to_p_Mg25_derived) = drate_dT; + } + } + + { + // Al26_to_He4_Na22_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Al26_to_He4_Na22_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Al26_to_He4_Na22_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Al26_to_He4_Na22_derived) = drate_dT; + } + } + + { + // Al27_to_He4_Na23_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Al27_to_He4_Na23_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Al27_to_He4_Na23_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Al27_to_He4_Na23_derived) = drate_dT; + } + } + + { + // Si28_to_p_Al27_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Si28_to_p_Al27_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Si28_to_p_Al27_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Si28_to_p_Al27_derived) = drate_dT; + } + } + + { + // Si28_to_He4_Mg24_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Si28_to_He4_Mg24_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Si28_to_He4_Mg24_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Si28_to_He4_Mg24_derived) = drate_dT; + } + } + + { + // Si29_to_He4_Mg25_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Si29_to_He4_Mg25_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Si29_to_He4_Mg25_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Si29_to_He4_Mg25_derived) = drate_dT; + } + } + + { + // P30_to_p_Si29_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_P30_to_p_Si29_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_P30_to_p_Si29_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_P30_to_p_Si29_derived) = drate_dT; + } + } + + { + // P30_to_He4_Al26_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_P30_to_He4_Al26_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_P30_to_He4_Al26_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_P30_to_He4_Al26_derived) = drate_dT; + } + } + + { + // P31_to_He4_Al27_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_P31_to_He4_Al27_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_P31_to_He4_Al27_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_P31_to_He4_Al27_derived) = drate_dT; + } + } + + { + // S32_to_p_P31_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_S32_to_p_P31_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_S32_to_p_P31_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_S32_to_p_P31_derived) = drate_dT; + } + } + + { + // S32_to_He4_Si28_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_S32_to_He4_Si28_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_S32_to_He4_Si28_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_S32_to_He4_Si28_derived) = drate_dT; + } + } + + { + // S33_to_He4_Si29_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_S33_to_He4_Si29_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_S33_to_He4_Si29_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_S33_to_He4_Si29_derived) = drate_dT; + } + } + + { + // Cl34_to_p_S33_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cl34_to_p_S33_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cl34_to_p_S33_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cl34_to_p_S33_derived) = drate_dT; + } + } + + { + // Cl34_to_He4_P30_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cl34_to_He4_P30_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cl34_to_He4_P30_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cl34_to_He4_P30_derived) = drate_dT; + } + } + + { + // Cl35_to_He4_P31_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cl35_to_He4_P31_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cl35_to_He4_P31_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cl35_to_He4_P31_derived) = drate_dT; + } + } + + { + // Ar36_to_p_Cl35_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ar36_to_p_Cl35_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ar36_to_p_Cl35_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ar36_to_p_Cl35_derived) = drate_dT; + } + } + + { + // Ar36_to_He4_S32_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ar36_to_He4_S32_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ar36_to_He4_S32_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ar36_to_He4_S32_derived) = drate_dT; + } + } + + { + // Ar37_to_He4_S33_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ar37_to_He4_S33_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ar37_to_He4_S33_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ar37_to_He4_S33_derived) = drate_dT; + } + } + + { + // K38_to_p_Ar37_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_K38_to_p_Ar37_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_K38_to_p_Ar37_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_K38_to_p_Ar37_derived) = drate_dT; + } + } + + { + // K38_to_He4_Cl34_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_K38_to_He4_Cl34_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_K38_to_He4_Cl34_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_K38_to_He4_Cl34_derived) = drate_dT; + } + } + + { + // K39_to_He4_Cl35_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_K39_to_He4_Cl35_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_K39_to_He4_Cl35_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_K39_to_He4_Cl35_derived) = drate_dT; + } + } + + { + // Ca40_to_p_K39_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ca40_to_p_K39_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ca40_to_p_K39_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ca40_to_p_K39_derived) = drate_dT; + } + } + + { + // Ca40_to_He4_Ar36_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ca40_to_He4_Ar36_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ca40_to_He4_Ar36_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ca40_to_He4_Ar36_derived) = drate_dT; + } + } + + { + // Ca41_to_He4_Ar37_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ca41_to_He4_Ar37_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ca41_to_He4_Ar37_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ca41_to_He4_Ar37_derived) = drate_dT; + } + } + + { + // Sc42_to_p_Ca41_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Sc42_to_p_Ca41_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Sc42_to_p_Ca41_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Sc42_to_p_Ca41_derived) = drate_dT; + } + } + + { + // Sc42_to_He4_K38_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Sc42_to_He4_K38_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Sc42_to_He4_K38_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Sc42_to_He4_K38_derived) = drate_dT; + } + } + + { + // Sc43_to_He4_K39_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Sc43_to_He4_K39_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Sc43_to_He4_K39_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Sc43_to_He4_K39_derived) = drate_dT; + } + } + + { + // Ti44_to_p_Sc43_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ti44_to_p_Sc43_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ti44_to_p_Sc43_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ti44_to_p_Sc43_derived) = drate_dT; + } + } + + { + // Ti44_to_He4_Ca40_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ti44_to_He4_Ca40_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ti44_to_He4_Ca40_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ti44_to_He4_Ca40_derived) = drate_dT; + } + } + + { + // Ti45_to_He4_Ca41_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ti45_to_He4_Ca41_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ti45_to_He4_Ca41_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ti45_to_He4_Ca41_derived) = drate_dT; + } + } + + { + // V46_to_p_Ti45_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_V46_to_p_Ti45_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_V46_to_p_Ti45_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_V46_to_p_Ti45_derived) = drate_dT; + } + } + + { + // V46_to_He4_Sc42_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_V46_to_He4_Sc42_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_V46_to_He4_Sc42_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_V46_to_He4_Sc42_derived) = drate_dT; + } + } + + { + // V47_to_He4_Sc43_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_V47_to_He4_Sc43_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_V47_to_He4_Sc43_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_V47_to_He4_Sc43_derived) = drate_dT; + } + } + + { + // Cr48_to_p_V47_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cr48_to_p_V47_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cr48_to_p_V47_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cr48_to_p_V47_derived) = drate_dT; + } + } + + { + // Cr48_to_He4_Ti44_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cr48_to_He4_Ti44_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cr48_to_He4_Ti44_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cr48_to_He4_Ti44_derived) = drate_dT; + } + } + + { + // Cr49_to_He4_Ti45_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cr49_to_He4_Ti45_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cr49_to_He4_Ti45_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cr49_to_He4_Ti45_derived) = drate_dT; + } + } + + { + // Mn50_to_p_Cr49_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mn50_to_p_Cr49_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mn50_to_p_Cr49_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mn50_to_p_Cr49_derived) = drate_dT; + } + } + + { + // Mn50_to_He4_V46_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mn50_to_He4_V46_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mn50_to_He4_V46_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mn50_to_He4_V46_derived) = drate_dT; + } + } + + { + // Mn51_to_He4_V47_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mn51_to_He4_V47_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mn51_to_He4_V47_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mn51_to_He4_V47_derived) = drate_dT; + } + } + + { + // Fe52_to_p_Mn51_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Fe52_to_p_Mn51_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Fe52_to_p_Mn51_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe52_to_p_Mn51_derived) = drate_dT; + } + } + + { + // Fe52_to_He4_Cr48_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Fe52_to_He4_Cr48_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Fe52_to_He4_Cr48_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe52_to_He4_Cr48_derived) = drate_dT; + } + } + + { + // Co55_to_He4_Mn51_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Co55_to_He4_Mn51_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Co55_to_He4_Mn51_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co55_to_He4_Mn51_derived) = drate_dT; + } + } + + { + // Ni56_to_p_Co55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni56_to_p_Co55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni56_to_p_Co55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni56_to_p_Co55_derived) = drate_dT; + } + } + + { + // Ni56_to_He4_Fe52_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni56_to_He4_Fe52_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni56_to_He4_Fe52_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni56_to_He4_Fe52_derived) = drate_dT; + } + } + + { + // C12_to_He4_He4_He4_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_C12_to_He4_He4_He4_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_C12_to_He4_He4_He4_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C12_to_He4_He4_He4_derived) = drate_dT; + } + } + + { + // He4_C12_to_p_N15_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_C12); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_C12); + } +#endif + rate_He4_C12_to_p_N15_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_C12_to_p_N15_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_C12_to_p_N15_derived) = drate_dT; + } + } + + { + // He4_N14_to_p_O17_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_N14); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_N14); + } +#endif + rate_He4_N14_to_p_O17_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_N14_to_p_O17_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_N14_to_p_O17_derived) = drate_dT; + } + } + + { + // He4_N15_to_p_O18_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_N15); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_N15); + } +#endif + rate_He4_N15_to_p_O18_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_N15_to_p_O18_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_N15_to_p_O18_derived) = drate_dT; + } + } + + { + // p_O16_to_He4_N13_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_O16); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_O16); + } +#endif + rate_p_O16_to_He4_N13_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_O16_to_He4_N13_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_O16_to_He4_N13_derived) = drate_dT; + } + } + + { + // He4_O16_to_p_F19_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_O16); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_O16); + } +#endif + rate_He4_O16_to_p_F19_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_O16_to_p_F19_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_O16_to_p_F19_derived) = drate_dT; + } + } + + { + // He4_Ne20_to_p_Na23_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ne20); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ne20); + } +#endif + rate_He4_Ne20_to_p_Na23_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Ne20_to_p_Na23_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ne20_to_p_Na23_derived) = drate_dT; + } + } + + { + // He4_Ne20_to_C12_C12_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ne20); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ne20); + } +#endif + rate_He4_Ne20_to_C12_C12_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Ne20_to_C12_C12_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ne20_to_C12_C12_derived) = drate_dT; + } + } + + { + // p_Ne21_to_He4_F18_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ne21); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ne21); + } +#endif + rate_p_Ne21_to_He4_F18_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Ne21_to_He4_F18_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ne21_to_He4_F18_derived) = drate_dT; + } + } + + { + // p_Ne22_to_He4_F19_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ne22); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ne22); + } +#endif + rate_p_Ne22_to_He4_F19_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Ne22_to_He4_F19_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ne22_to_He4_F19_derived) = drate_dT; + } + } + + { + // p_Na23_to_C12_C12_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Na23); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Na23); + } +#endif + rate_p_Na23_to_C12_C12_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Na23_to_C12_C12_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Na23_to_C12_C12_derived) = drate_dT; + } + } + + { + // He4_Mg24_to_p_Al27_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mg24); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mg24); + } +#endif + rate_He4_Mg24_to_p_Al27_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Mg24_to_p_Al27_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mg24_to_p_Al27_derived) = drate_dT; + } + } + + { + // He4_Mg24_to_C12_O16_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mg24); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mg24); + } +#endif + rate_He4_Mg24_to_C12_O16_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Mg24_to_C12_O16_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mg24_to_C12_O16_derived) = drate_dT; + } + } + + { + // p_Mg25_to_He4_Na22_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Mg25); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Mg25); + } +#endif + rate_p_Mg25_to_He4_Na22_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Mg25_to_He4_Na22_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Mg25_to_He4_Na22_derived) = drate_dT; + } + } + + { + // p_Al27_to_C12_O16_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Al27); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Al27); + } +#endif + rate_p_Al27_to_C12_O16_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Al27_to_C12_O16_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Al27_to_C12_O16_derived) = drate_dT; + } + } + + { + // He4_Si28_to_p_P31_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Si28); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Si28); + } +#endif + rate_He4_Si28_to_p_P31_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Si28_to_p_P31_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Si28_to_p_P31_derived) = drate_dT; + } + } + + { + // He4_Si28_to_C12_Ne20_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Si28); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Si28); + } +#endif + rate_He4_Si28_to_C12_Ne20_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Si28_to_C12_Ne20_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Si28_to_C12_Ne20_derived) = drate_dT; + } + } + + { + // He4_Si28_to_O16_O16_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Si28); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Si28); + } +#endif + rate_He4_Si28_to_O16_O16_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Si28_to_O16_O16_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Si28_to_O16_O16_derived) = drate_dT; + } + } + + { + // p_Si29_to_He4_Al26_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Si29); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Si29); + } +#endif + rate_p_Si29_to_He4_Al26_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Si29_to_He4_Al26_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Si29_to_He4_Al26_derived) = drate_dT; + } + } + + { + // p_P31_to_C12_Ne20_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_P31); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_P31); + } +#endif + rate_p_P31_to_C12_Ne20_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_P31_to_C12_Ne20_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_P31_to_C12_Ne20_derived) = drate_dT; + } + } + + { + // p_P31_to_O16_O16_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_P31); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_P31); + } +#endif + rate_p_P31_to_O16_O16_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_P31_to_O16_O16_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_P31_to_O16_O16_derived) = drate_dT; + } + } + + { + // He4_S32_to_p_Cl35_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_S32); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_S32); + } +#endif + rate_He4_S32_to_p_Cl35_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_S32_to_p_Cl35_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_S32_to_p_Cl35_derived) = drate_dT; + } + } + + { + // p_S33_to_He4_P30_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_S33); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_S33); + } +#endif + rate_p_S33_to_He4_P30_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_S33_to_He4_P30_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_S33_to_He4_P30_derived) = drate_dT; + } + } + + { + // He4_Ar36_to_p_K39_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ar36); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ar36); + } +#endif + rate_He4_Ar36_to_p_K39_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Ar36_to_p_K39_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ar36_to_p_K39_derived) = drate_dT; + } + } + + { + // p_Ar37_to_He4_Cl34_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ar37); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ar37); + } +#endif + rate_p_Ar37_to_He4_Cl34_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Ar37_to_He4_Cl34_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ar37_to_He4_Cl34_derived) = drate_dT; + } + } + + { + // He4_Ca40_to_p_Sc43_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ca40); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ca40); + } +#endif + rate_He4_Ca40_to_p_Sc43_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Ca40_to_p_Sc43_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ca40_to_p_Sc43_derived) = drate_dT; + } + } + + { + // p_Ca41_to_He4_K38_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ca41); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ca41); + } +#endif + rate_p_Ca41_to_He4_K38_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Ca41_to_He4_K38_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ca41_to_He4_K38_derived) = drate_dT; + } + } + + { + // p_Ti45_to_He4_Sc42_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ti45); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ti45); + } +#endif + rate_p_Ti45_to_He4_Sc42_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Ti45_to_He4_Sc42_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ti45_to_He4_Sc42_derived) = drate_dT; + } + } + + { + // p_V47_to_He4_Ti44_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_V47); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_V47); + } +#endif + rate_p_V47_to_He4_Ti44_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_V47_to_He4_Ti44_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_V47_to_He4_Ti44_derived) = drate_dT; + } + } + + { + // p_Cr49_to_He4_V46_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Cr49); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Cr49); + } +#endif + rate_p_Cr49_to_He4_V46_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Cr49_to_He4_V46_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Cr49_to_He4_V46_derived) = drate_dT; + } + } + + { + // p_Mn51_to_He4_Cr48_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Mn51); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Mn51); + } +#endif + rate_p_Mn51_to_He4_Cr48_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Mn51_to_He4_Cr48_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Mn51_to_He4_Cr48_derived) = drate_dT; + } + } + + { + // p_Mn52_to_He4_Cr49_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Mn52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Mn52); + } +#endif + rate_p_Mn52_to_He4_Cr49_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Mn52_to_He4_Cr49_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Mn52_to_He4_Cr49_derived) = drate_dT; + } + } + + { + // p_Co55_to_He4_Fe52_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co55); + } +#endif + rate_p_Co55_to_He4_Fe52_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Co55_to_He4_Fe52_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co55_to_He4_Fe52_derived) = drate_dT; + } + } + + { + // Mn51_to_n_Mn50_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mn51_to_n_Mn50_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mn51_to_n_Mn50_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mn51_to_n_Mn50_derived) = drate_dT; + } + } + + { + // Mn52_to_n_Mn51_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Mn52_to_n_Mn51_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Mn52_to_n_Mn51_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Mn52_to_n_Mn51_derived) = drate_dT; + } + } + + { + // Fe53_to_n_Fe52_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Fe53_to_n_Fe52_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Fe53_to_n_Fe52_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe53_to_n_Fe52_derived) = drate_dT; + } + } + + { + // Fe53_to_p_Mn52_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Fe53_to_p_Mn52_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Fe53_to_p_Mn52_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe53_to_p_Mn52_derived) = drate_dT; + } + } + + { + // Fe54_to_n_Fe53_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Fe54_to_n_Fe53_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Fe54_to_n_Fe53_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe54_to_n_Fe53_derived) = drate_dT; + } + } + + { + // Fe55_to_n_Fe54_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Fe55_to_n_Fe54_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Fe55_to_n_Fe54_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe55_to_n_Fe54_derived) = drate_dT; + } + } + + { + // Fe56_to_n_Fe55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Fe56_to_n_Fe55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Fe56_to_n_Fe55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Fe56_to_n_Fe55_derived) = drate_dT; + } + } + + { + // Co55_to_p_Fe54_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Co55_to_p_Fe54_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Co55_to_p_Fe54_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co55_to_p_Fe54_derived) = drate_dT; + } + } + + { + // Co56_to_n_Co55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Co56_to_n_Co55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Co56_to_n_Co55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co56_to_n_Co55_derived) = drate_dT; + } + } + + { + // Co56_to_p_Fe55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Co56_to_p_Fe55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Co56_to_p_Fe55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co56_to_p_Fe55_derived) = drate_dT; + } + } + + { + // Co56_to_He4_Mn52_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Co56_to_He4_Mn52_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Co56_to_He4_Mn52_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co56_to_He4_Mn52_derived) = drate_dT; + } + } + + { + // Co57_to_n_Co56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Co57_to_n_Co56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Co57_to_n_Co56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co57_to_n_Co56_derived) = drate_dT; + } + } + + { + // Co57_to_p_Fe56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Co57_to_p_Fe56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Co57_to_p_Fe56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Co57_to_p_Fe56_derived) = drate_dT; + } + } + + { + // Ni57_to_n_Ni56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni57_to_n_Ni56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni57_to_n_Ni56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni57_to_n_Ni56_derived) = drate_dT; + } + } + + { + // Ni57_to_p_Co56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni57_to_p_Co56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni57_to_p_Co56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni57_to_p_Co56_derived) = drate_dT; + } + } + + { + // Ni57_to_He4_Fe53_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni57_to_He4_Fe53_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni57_to_He4_Fe53_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni57_to_He4_Fe53_derived) = drate_dT; + } + } + + { + // Ni58_to_n_Ni57_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni58_to_n_Ni57_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni58_to_n_Ni57_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni58_to_n_Ni57_derived) = drate_dT; + } + } + + { + // Ni58_to_p_Co57_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni58_to_p_Co57_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni58_to_p_Co57_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni58_to_p_Co57_derived) = drate_dT; + } + } + + { + // Ni58_to_He4_Fe54_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Ni58_to_He4_Fe54_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Ni58_to_He4_Fe54_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Ni58_to_He4_Fe54_derived) = drate_dT; + } + } + + { + // Cu59_to_p_Ni58_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cu59_to_p_Ni58_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cu59_to_p_Ni58_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cu59_to_p_Ni58_derived) = drate_dT; + } + } + + { + // Cu59_to_He4_Co55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Cu59_to_He4_Co55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Cu59_to_He4_Co55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Cu59_to_He4_Co55_derived) = drate_dT; + } + } + + { + // Zn60_to_p_Cu59_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Zn60_to_p_Cu59_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Zn60_to_p_Cu59_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Zn60_to_p_Cu59_derived) = drate_dT; + } + } + + { + // Zn60_to_He4_Ni56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_Zn60_to_He4_Ni56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_Zn60_to_He4_Ni56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_Zn60_to_He4_Ni56_derived) = drate_dT; + } + } + + { + // p_Mn52_to_n_Fe52_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Mn52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Mn52); + } +#endif + rate_p_Mn52_to_n_Fe52_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Mn52_to_n_Fe52_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Mn52_to_n_Fe52_derived) = drate_dT; + } + } + + { + // He4_Mn52_to_n_Co55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mn52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mn52); + } +#endif + rate_He4_Mn52_to_n_Co55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Mn52_to_n_Co55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mn52_to_n_Co55_derived) = drate_dT; + } + } + + { + // p_Fe53_to_He4_Mn50_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe53); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe53); + } +#endif + rate_p_Fe53_to_He4_Mn50_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Fe53_to_He4_Mn50_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe53_to_He4_Mn50_derived) = drate_dT; + } + } + + { + // He4_Fe53_to_n_Ni56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe53); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe53); + } +#endif + rate_He4_Fe53_to_n_Ni56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Fe53_to_n_Ni56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe53_to_n_Ni56_derived) = drate_dT; + } + } + + { + // p_Fe54_to_He4_Mn51_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe54); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe54); + } +#endif + rate_p_Fe54_to_He4_Mn51_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Fe54_to_He4_Mn51_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe54_to_He4_Mn51_derived) = drate_dT; + } + } + + { + // He4_Fe54_to_n_Ni57_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe54); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe54); + } +#endif + rate_He4_Fe54_to_n_Ni57_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Fe54_to_n_Ni57_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe54_to_n_Ni57_derived) = drate_dT; + } + } + + { + // He4_Fe54_to_p_Co57_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe54); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe54); + } +#endif + rate_He4_Fe54_to_p_Co57_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Fe54_to_p_Co57_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe54_to_p_Co57_derived) = drate_dT; + } + } + + { + // p_Fe55_to_n_Co55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe55); + } +#endif + rate_p_Fe55_to_n_Co55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Fe55_to_n_Co55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe55_to_n_Co55_derived) = drate_dT; + } + } + + { + // p_Fe55_to_He4_Mn52_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe55); + } +#endif + rate_p_Fe55_to_He4_Mn52_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Fe55_to_He4_Mn52_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe55_to_He4_Mn52_derived) = drate_dT; + } + } + + { + // He4_Fe55_to_n_Ni58_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe55); + } +#endif + rate_He4_Fe55_to_n_Ni58_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Fe55_to_n_Ni58_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe55_to_n_Ni58_derived) = drate_dT; + } + } + + { + // p_Fe56_to_n_Co56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe56); + } +#endif + rate_p_Fe56_to_n_Co56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Fe56_to_n_Co56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe56_to_n_Co56_derived) = drate_dT; + } + } + + { + // p_Co56_to_n_Ni56_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co56); + } +#endif + rate_p_Co56_to_n_Ni56_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Co56_to_n_Ni56_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co56_to_n_Ni56_derived) = drate_dT; + } + } + + { + // p_Co56_to_He4_Fe53_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co56); + } +#endif + rate_p_Co56_to_He4_Fe53_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Co56_to_He4_Fe53_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co56_to_He4_Fe53_derived) = drate_dT; + } + } + + { + // He4_Co56_to_n_Cu59_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Co56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Co56); + } +#endif + rate_He4_Co56_to_n_Cu59_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Co56_to_n_Cu59_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Co56_to_n_Cu59_derived) = drate_dT; + } + } + + { + // p_Co57_to_n_Ni57_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co57); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co57); + } +#endif + rate_p_Co57_to_n_Ni57_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Co57_to_n_Ni57_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co57_to_n_Ni57_derived) = drate_dT; + } + } + + { + // He4_Ni56_to_p_Cu59_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ni56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ni56); + } +#endif + rate_He4_Ni56_to_p_Cu59_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Ni56_to_p_Cu59_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ni56_to_p_Cu59_derived) = drate_dT; + } + } + + { + // He4_Ni57_to_n_Zn60_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ni57); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ni57); + } +#endif + rate_He4_Ni57_to_n_Zn60_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_He4_Ni57_to_n_Zn60_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ni57_to_n_Zn60_derived) = drate_dT; + } + } + + { + // p_Ni58_to_He4_Co55_derived + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ni58); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ni58); + } +#endif + rate_p_Ni58_to_He4_Co55_derived(tfactors, log_scor, dlog_scor_dT, rate, drate_dT, rate_eval, pf_cache); + rate_eval.screened_rates(k_p_Ni58_to_He4_Co55_derived) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ni58_to_He4_Co55_derived) = drate_dT; + } + } + + +} +#endif diff --git a/networks/he-burn/ase-big/interp_tools.H b/networks/he-burn/ase-big/interp_tools.H new file mode 100644 index 000000000..40246f85a --- /dev/null +++ b/networks/he-burn/ase-big/interp_tools.H @@ -0,0 +1,219 @@ +#ifndef INTERP_TOOLS_H +#define INTERP_TOOLS_H + +#include + +using namespace amrex::literals; + +namespace interp_net { + + // index locator + // return the index i such that x_array[i] <= x0 < x_array[i+1] + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + int + find_index(const amrex::Real x0, const T& x_array) { + + int left = x_array.lo(); + int right = x_array.hi(); + + int idx = -1; + + if (x0 >= x_array(left) && x0 < x_array(right)) { + + // find the largest x element <= x0 using a + // binary search + + while (left < right) { + int mid = (left + right) / 2; + if (x_array(mid) > x0) { + right = mid; + } else { + left = mid + 1; + } + } + + idx = right - 1; + } + + return idx; + } + + // an index locator that extrapolates at the boundaries instead + // of returning -1 + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + int + find_index_extrap(const amrex::Real x0, const T& x_array) { + + int left = x_array.lo(); + int right = x_array.hi(); + + int idx; + + if (x0 < x_array(left)) { + idx = left; + } else if (x0 >= x_array(right)) { + idx = right - 1; + } else { + idx = find_index(x0, x_array); + } + + return idx; + } + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + std::pair + linear_extrap(const amrex::Real xv, const int idx0, const int idx1, + const T& x_array, const T& f_array) { + + const auto x0 = x_array(idx0); + const auto x1 = x_array(idx1); + + const auto f0 = f_array(idx0); + const auto f1 = f_array(idx1); + + const amrex::Real slope = (f1 - f0) / (x1 - x0); + const amrex::Real f = f0 + slope * (xv - x0); + + amrex::Real dfdx {0.0_rt}; + if constexpr (do_derivative) { + dfdx = slope; + } + + return {f, dfdx}; + } + + AMREX_GPU_HOST_DEVICE AMREX_INLINE + amrex::Real + limit_slope(const amrex::Real hm, const amrex::Real hp, + const amrex::Real dm, const amrex::Real dp) { + // Slope Limiter to preserve monotonicity + // See C. Moler, Numerical Computing with Matlab, 2004. + // :doi:`10.1137/1.9780898717952`, Chapter 3.4 + + if (dm * dp <= 0.0_rt) { + return 0.0_rt; + } + + const amrex::Real w1 = 2.0_rt * hp + hm; + const amrex::Real w2 = hp + 2.0_rt * hm; + return (w1 + w2) / (w1 / dm + w2 / dp); + } + + // Monotone cubic Hermite interpolation + // Uses Hermite polynomials as basis to construct the cubic interpolant + // + // H(x) = f0 H_{1,0}(x) + f1 H_{1,1}(x) + f'0 Ĥ_{1,0}(x) + f'1 Ĥ_{1,0}(x) + // + // The slope f' is limited to preserve monotonicity. + // Also use simple one-sided slope for edge cases + // this version works for unevenly spaced data points + // it will return f and f' at x = xv + // + // See C. Moler, Numerical Computing with Matlab, 2004. + // :doi:`10.1137/1.9780898717952`, Chapter 3.4 and 3.6 + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + std::pair + monotone_cubic_interp(const amrex::Real xv, const int idx, + const T& x_array, const T& f_array) { + + const int ilo = x_array.lo(); + const int ihi = x_array.hi(); + + // Clamp index within table boundary + // Note idx should already be clamped within [ilo, ihi-1] + AMREX_ASSERT(idx >= ilo && idx < ihi); + + const int im1 = amrex::max(idx - 1, ilo); + const int ip1 = idx + 1; + const int ip2 = amrex::min(idx + 2, ihi); + + const auto x_im1 = x_array(im1); + const auto x_idx = x_array(idx); + const auto x_ip1 = x_array(ip1); + const auto x_ip2 = x_array(ip2); + + const auto f_im1 = f_array(im1); + const auto f_idx = f_array(idx); + const auto f_ip1 = f_array(ip1); + const auto f_ip2 = f_array(ip2); + + // Compute the slope at i0 and i0 + 1 + amrex::Real m0, m1; + m1 = m0 = (f_ip1 - f_idx) / (x_ip1 - x_idx); + + // If NOT on the edge, compute the slope from the other side + // and limit the slope to preserve monotonicity + if (idx != ilo) { + amrex::Real d_im1 = (f_idx - f_im1) / (x_idx - x_im1); + m0 = limit_slope(x_idx - x_im1, x_ip1 - x_idx, d_im1, m0); + } + + if (ip1 != ihi) { + amrex::Real d_ip1 = (f_ip2 - f_ip1) / (x_ip2 - x_ip1); + m1 = limit_slope(x_ip1 - x_idx, x_ip2 - x_ip1, m1, d_ip1); + } + + // Compute cubic Hermite polynomial basis + const amrex::Real h = x_ip1 - x_idx; + const amrex::Real t = (xv - x_idx) / h; + const amrex::Real t2 = t * t; + const amrex::Real t3 = t2 * t; + + const amrex::Real H1 = -2.0_rt * t3 + 3.0_rt * t2; + const amrex::Real H0 = -H1 + 1.0_rt; + const amrex::Real Hhat1 = h * (t3 - t2); + const amrex::Real Hhat0 = h * (t3 - 2.0_rt * t2 + t); + + // Construct the interpolant + // H_3(x) = f0 H_{1,0}(x) + f1 H_{1,1}(x) + f'0 Ĥ_{1,0}(x) + f'1 Ĥ_{1,0}(x) + + const amrex::Real fv = f_idx * H0 + f_ip1 * H1 + m0 * Hhat0 + m1 * Hhat1; + + // Compute the derivative if necessary + amrex::Real dfdx {0.0_rt}; + if constexpr (do_derivative) { + const amrex::Real dH1dx = -6.0_rt * (t2 - t) / h; + const amrex::Real dH0dx = -dH1dx; + const amrex::Real dHhat1dx = 3.0_rt * t2 - 2.0_rt * t; + const amrex::Real dHhat0dx = 3.0_rt * t2 - 4.0_rt * t + 1.0_rt; + dfdx = f_idx * dH0dx + f_ip1 * dH1dx + m0 * dHhat0dx + m1 * dHhat1dx; + } + + return {fv, dfdx}; + } + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + std::pair + monotone_1d_interp(const amrex::Real xv, const T& x_array, const T& f_array) { + // Main driver for interpolating and extrapolating 1D table data. + // Uses monotone Hermite cubic interpolation and linear extrapolation + // to preserve monotonicity. + + // find the index such that x_array[idx] <= xv < x_array[idx+1] + // We already ensure that ilo <= i <= ihi - 1 + const int idx = interp_net::find_index_extrap(xv, x_array); + + const int ilo = x_array.lo(); + const int ihi = x_array.hi(); + + if (xv < x_array(ilo)) { + return linear_extrap(xv, ilo, ilo+1, x_array, f_array); + } + + if (xv > x_array(ihi)){ + return linear_extrap(xv, ihi, ihi-1, x_array, f_array); + } + + return monotone_cubic_interp(xv, idx, x_array, f_array); + } + +} +#endif diff --git a/networks/he-burn/ase-big/modified_rates.H b/networks/he-burn/ase-big/modified_rates.H new file mode 100644 index 000000000..37deb2947 --- /dev/null +++ b/networks/he-burn/ase-big/modified_rates.H @@ -0,0 +1,31 @@ +#ifndef MODIFIED_RATES_H +#define MODIFIED_RATES_H + +#include +#include + +#include +#include +#include +#include +#include + +namespace modified_rates { + + using namespace temp_tabular; + + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + void + fill_rates([[maybe_unused]] const tf_t& tfactors, + [[maybe_unused]] T& rate_eval) + { + + [[maybe_unused]] amrex::Real rate; + [[maybe_unused]] amrex::Real drate_dT; + + + } +} +#endif diff --git a/networks/he-burn/ase-big/partition_functions.H b/networks/he-burn/ase-big/partition_functions.H new file mode 100644 index 000000000..c8ebfbcc2 --- /dev/null +++ b/networks/he-burn/ase-big/partition_functions.H @@ -0,0 +1,1842 @@ +#ifndef PARTITION_FUNCTIONS_H +#define PARTITION_FUNCTIONS_H + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace amrex::literals; +using namespace Species; + +namespace part_fun { + + constexpr int npts_1 = 72; + + // this is T9 + + inline AMREX_GPU_DEVICE amrex::Array1D temp_array_1 = { + 0.01, 0.15, 0.2, 0.3, 0.4, + 0.5, 0.6, 0.7, 0.8, 0.9, + 1.0, 1.5, 2.0, 2.5, 3.0, + 3.5, 4.0, 4.5, 5.0, 6.0, + 7.0, 8.0, 9.0, 10.0, 12.0, + 14.0, 16.0, 18.0, 20.0, 22.0, + 24.0, 26.0, 28.0, 30.0, 35.0, + 40.0, 45.0, 50.0, 55.0, 60.0, + 65.0, 70.0, 75.0, 80.0, 85.0, + 90.0, 95.0, 100.0, 105.0, 110.0, + 115.0, 120.0, 125.0, 130.0, 135.0, + 140.0, 145.0, 150.0, 155.0, 160.0, + 165.0, 170.0, 175.0, 180.0, 190.0, + 200.0, 210.0, 220.0, 230.0, 240.0, + 250.0, 275.0, + }; + + + // O16 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D O16_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.02955880224154443, + 0.08617769624105241, 0.16551443847757333, 0.27763173659827955, 0.4252677354043441, 0.6043159668533296, + 0.7975071958841882, 1.007957920399979, 1.2296405510745139, 1.4609379041156563, 2.0681277817795625, + 2.70805020110221, 3.3775875160230218, 4.062165663857866, 4.7535901911063645, 5.4510384535657, + 6.142037405587356, 6.828712071641684, 7.512071245835466, 8.185907481482324, 8.85366542803745, + 9.517825071724143, 10.177324218165856, 10.831706855275558, 11.48246625748552, 12.128111104060462, + 12.774223335915433, 13.41652441595382, 14.054527458434775, 14.690979295318174, 15.324022551808413, + 15.956752500549557, 16.588099280204055, 17.216707939626428, 17.842646370492925, 18.469470908121796, + 19.09362521719479, 19.715407911546766, 20.337603356134426, 20.954377557909798, 22.19802884605391, + 23.43796058076729, 24.670655986211848, 25.905049387238495, 27.136724794113768, 28.368185181905268, + 29.602320498988682, 32.68726692127686, + }; + + constexpr amrex::Real O16_pf_threshold_T9 = 10.0; + + // O17 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D O17_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.009950330853168092, 0.009950330853168092, + 0.01980262729617973, 0.02955880224154443, 0.03922071315328133, 0.03922071315328133, 0.058268908123975824, + 0.0769610411361284, 0.09531017980432493, 0.12221763272424911, 0.13976194237515863, 0.2151113796169455, + 0.30010459245033816, 0.4054651081081644, 0.5364933705145685, 0.6830968447064438, 0.8458682675776092, + 1.0260415958332743, 1.2178757094949273, 1.4182774069729414, 1.631199404215613, 2.1972245773362196, + 2.803360380906535, 3.4339872044851463, 4.07753744390572, 4.727387818712341, 5.3706380281276624, + 6.018593214496234, 6.660575149839686, 7.299797366758161, 7.937374696163295, 8.573573524852344, + 9.20833836930551, 9.84161214881804, 10.474467099121865, 11.107960231903714, 11.744037185933616, + 12.375815420117268, 13.008074231002201, 13.641157170819497, 14.27293540500315, 14.907433858481587, + 15.541842221869874, 16.176364559082295, 16.811242831518264, 17.445170652418238, 18.081003376382203, + 18.713350357915186, 19.35284482498281, 19.98721115537519, 20.6234455016642, 21.895747974180978, + 23.17427093505873, 24.448959264183063, 25.72721214289187, 27.01298140785541, 28.298850488504204, + 29.585466167433697, 32.8184069217693, + }; + + constexpr amrex::Real O17_pf_threshold_T9 = 2.0; + + // O18 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D O18_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.009950330853168092, 0.01980262729617973, 0.02955880224154443, 0.04879016416943204, 0.11332868530700327, + 0.19885085874516517, 0.3074846997479607, 0.4252677354043441, 0.5481214085096876, 0.883767540168595, + 1.1786549963416462, 1.4586150226995167, 1.7209792871670078, 1.965712776351493, 2.1972245773362196, + 2.424802725718295, 2.6390573296152584, 2.8622008809294686, 3.0819099697950434, 3.66612246699132, + 4.302712827954156, 4.983606621708336, 5.700443573390687, 6.428105272684596, 7.162397497355718, + 7.893572073504902, 8.623353387244627, 9.350102314351341, 10.069001991013701, 10.783114300038692, + 11.496796083040344, 12.206072645530174, 12.91410843858387, 13.619495674038317, 14.322328160332725, + 15.02447090380125, 15.72357048288849, 16.41820024340866, 17.118727531266227, 17.81371125963347, + 18.50685844019342, 19.200005620753362, 19.895443753059865, 20.586299981873253, 21.27715095017285, + 21.96742043090518, 22.659125650148223, 23.34793442910957, 24.037451841618935, 25.414613719175556, + 26.794003564948902, 28.17334540675391, 29.552345789511246, 30.930554843814203, 32.31315234305277, + 33.697129206032294, 37.163444987073845, + }; + + constexpr amrex::Real O18_pf_threshold_T9 = 3.0; + + // F18 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D F18_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.01980262729617973, 0.058268908123975824, 0.11332868530700327, + 0.19885085874516517, 0.28517894223366247, 0.3852624007906449, 0.4762341789963717, 0.6523251860396901, + 0.8064758658669485, 0.9360933591703348, 1.0438040521731147, 1.1378330018213911, 1.5303947050936475, + 1.742219023667919, 1.9387416595767009, 2.125847914493992, 2.312535423847214, 2.4932054526026954, + 2.681021528714291, 2.8791984572980396, 3.0819099697950434, 3.292126286607793, 3.856510295497887, + 4.468204330914934, 5.111987788356544, 5.768320995793772, 6.431331081933479, 7.098375638590786, + 7.757906208351747, 8.420682291035394, 9.080231686629162, 9.740968623038354, 10.395130356885344, + 11.052476048529304, 11.711776323715394, 12.367340793126296, 13.025852477023484, 13.68426227135432, + 14.346138809026444, 15.003353980360327, 15.665538935316304, 16.325109820342647, 16.98938901690174, + 17.654962870557586, 18.319754825362406, 18.985994553002424, 19.650321295026878, 20.316800228504665, + 20.985630101413904, 21.65148513968584, 22.32265341352701, 22.991259485170836, 24.334183749590636, + 25.679092894547672, 27.02771463936839, 28.377709063416525, 29.735155270198756, 31.093627125719348, + 32.45933485323085, 35.88424876151032, + }; + + constexpr amrex::Real F18_pf_threshold_T9 = 1.5; + + // F19 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D F19_pf_array = { + 0.0, 0.0, 0.0, 0.01980262729617973, 0.04879016416943204, + 0.10436001532424286, 0.1823215567939546, 0.25464221837358075, 0.3293037471426003, 0.4054651081081644, + 0.4762341789963717, 0.7514160886839212, 0.9282193027394288, 1.0473189942805592, 1.1378330018213911, + 1.208960345836975, 1.2725655957915476, 1.3270750014599193, 1.3762440252663892, 1.4701758451005926, + 1.5518087995974639, 1.62924053973028, 1.6974487897568136, 1.763017000362401, 1.9643112344262046, + 2.131796772013764, 2.302585092994046, 2.4849066497880004, 2.667228206581955, 2.8622008809294686, + 3.068052935133617, 3.2846635654062037, 3.5115454388310208, 3.7471483622379123, 4.387014176184921, + 5.075173815233827, 5.7899601708972535, 6.519147287940395, 7.251344983372214, 7.986164860332727, + 8.719317375506371, 9.449357272446683, 10.177324218165856, 10.902279505922026, 11.626254150277232, + 12.35017298950393, 13.077366011473593, 13.800396920154226, 14.52354635101797, 15.250595083253597, + 15.974225280538619, 16.70031127081098, 17.423722109010754, 18.148872020656874, 18.87175636331258, + 19.599335740294013, 20.322788270349285, 21.045349336115525, 21.774087461778173, 22.49991166836442, + 23.22470178868562, 23.954070232679886, 24.678348331835004, 25.40539706407063, 26.860992891032645, + 28.319155754664948, 29.7781213060822, 31.23923266697503, 32.70619493116237, 34.17205111511845, + 35.644033226297466, 39.33456694050743, + }; + + constexpr amrex::Real F19_pf_threshold_T9 = 0.2; + + // Ne20 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ne20_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 1.5999872001381317e-05, 0.00038192705657577196, 0.0025407695097516073, 0.008962714607884434, + 0.02196890666877481, 0.04281712292730049, 0.07155385603147618, 0.10734115290026017, 0.19485435877707374, + 0.2952416765065437, 0.4013680599901673, 0.5094424676464369, 0.6178722970606984, 0.8329091229351039, + 1.0508216248317612, 1.269760544863939, 1.4929040961781488, 1.7191887763932197, 1.9530276168241774, + 2.194999882314108, 2.451005098112319, 2.714694743820879, 3.0007198150650303, 3.784189633918261, + 4.6443908991413725, 5.54907608489522, 6.46302945692067, 7.371489295214277, 8.266164436612492, + 9.148464968258095, 10.021270588192511, 10.881813675329736, 11.736069016284437, 12.584509081250419, + 13.425426551894413, 14.26019637922572, 15.096444403426338, 15.926935145497161, 16.75467248002987, + 17.579033555073977, 18.40149792453559, 19.222682329424394, 20.040068987239636, 20.854294099352817, + 21.671055235879937, 22.481123754498785, 23.295878067153517, 24.100853352969434, 24.909885675277682, + 25.720478110710527, 26.525384212323473, 27.329916023144627, 28.131796403841037, 29.741234316275136, + 31.347029237430736, 32.94914110977277, 34.548726725763856, 36.15618247699396, 37.76164424104842, + 39.36709013221299, 43.378053085496035, + }; + + constexpr amrex::Real Ne20_pf_threshold_T9 = 1.0; + + // Ne21 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ne21_pf_array = { + 0.0, 0.0, 0.0, 1.9999980000601777e-06, 5.6998375561702104e-05, + 0.00043790410599996464, 0.0016975583321979725, 0.004468003589507688, 0.00921937069756716, 0.01616858116158369, + 0.02529633275369882, 0.09484097883767402, 0.1790771326706854, 0.25859486149358507, 0.3283586964062474, + 0.3888796601363511, 0.4420470864506867, 0.48975968683011206, 0.5335762543684043, 0.6140368714011162, + 0.6898788453664597, 0.7646954508989865, 0.8404756418851278, 0.9183047024732123, 1.0818051703517284, + 1.2584609896100056, 1.4469189829363254, 1.6524974018945473, 1.8748743759385615, 2.1138429683971682, + 2.3702437414678603, 2.6461747973841225, 2.9391619220655967, 3.242592351485517, 4.053522567701846, + 4.897839799950911, 5.755742213586912, 6.60934924316738, 7.455876687491824, 8.296546520300614, + 9.131297164635729, 9.961756460660103, 10.785186839640664, 11.608235644774552, 12.425208175446844, + 13.244581010128577, 14.0623706358958, 14.880221294956703, 15.698024390460793, 16.51687177091569, + 17.33300839532259, 18.148872020656874, 18.963005034777726, 19.781657297087968, 20.596568183900455, + 21.41140047568281, 22.227343233722685, 23.045653557236637, 23.85876005287556, 24.676430785705733, + 25.493950461412076, 26.30676214572811, 27.125183033673597, 27.93850581567651, 29.575501672174266, + 31.21175841142278, 32.851376941006876, 34.49168478737683, 36.136141726110516, 37.781368746396204, + 39.42912552313244, 43.572379588386816, + }; + + constexpr amrex::Real Ne21_pf_threshold_T9 = 0.2; + + // Ne22 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ne22_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 1.9999980000601777e-06, 0.00026096594542543384, 0.003066294111560706, 0.013387979718225645, 0.035508060548991756, + 0.07064204418711705, 0.11730025246866588, 0.17270294591563148, 0.23395766741330531, 0.3650964830226763, + 0.4991697573134882, 0.6322468332347257, 0.7641637363491882, 0.8959823046827724, 1.1631508098056809, + 1.43746264769429, 1.7191887763932197, 2.0082140323914683, 2.302585092994046, 2.6100697927420065, + 2.928523523860541, 3.261935314328648, 3.6109179126442243, 3.970291913552122, 4.912654885736052, + 5.886104031450156, 6.863803391452954, 7.832014180505469, 8.790269111478656, 9.735068900911164, + 10.668955394675699, 11.589886506106357, 12.509874099861838, 13.423948355025102, 14.328334184392938, + 15.233787964937216, 16.1378982782545, 17.034386382832476, 17.929657747482555, 18.82614585206053, + 19.715407911546766, 20.60560779347818, 21.493374058642484, 22.381493913549942, 23.264867830410957, + 24.15078052692594, 25.034064962331925, 25.916222687836623, 26.798611868035096, 27.67981128009798, + 28.559240418667976, 29.437669197650354, 30.31886860971324, 31.1949040798678, 32.95403109506696, + 34.70429083338826, 36.464483836648476, 38.22012758260383, 39.98119410543248, 41.73920128785564, + 43.50065540758837, 47.91423039999717, + }; + + constexpr amrex::Real Ne22_pf_threshold_T9 = 0.9; + + // Na22 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Na22_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 9.999994999180668e-07, 5.99998200002249e-06, 2.999955000897429e-05, 0.00010499448788586636, 0.0002759619190066846, + 0.000604817061281531, 0.006891201037725975, 0.02495306647419179, 0.05592181623486148, 0.09769188674184422, + 0.14741864185241996, 0.2025530136982008, 0.26107420192529707, 0.3214673673699074, 0.44383674294773623, + 0.5644685655687769, 0.681316978856267, 0.7939920158627449, 0.9029100079448062, 1.1118575154181303, + 1.3164082336557241, 1.5260563034950492, 1.742219023667919, 1.9712993830601329, 2.2181159363675955, + 2.4849066497880004, 2.766319109226186, 3.0587070727153796, 3.370738174177447, 4.194189897191817, + 5.049856007249537, 5.918893854273146, 6.786716950605081, 7.649692623711514, 8.509161019718974, + 9.367344120785848, 10.21464198117305, 11.06350846933288, 11.911701584927597, 12.757080058928997, + 13.602317337503232, 14.446782334806132, 15.294839785051353, 16.1378982782545, 16.98938901690174, + 17.837284427351538, 18.683045008419857, 19.532538259370497, 20.380775527999635, 21.230083439314864, + 22.079100990581594, 22.928238101073457, 23.77726701862438, 24.627256670677294, 25.476856028052776, + 26.329067903242407, 27.180035492518574, 28.029797235885916, 28.883784084423915, 30.591126211839388, + 32.30384995039046, 34.01621551492627, 35.73269886338312, 37.451127059525625, 39.17350538314032, + 40.90524684264212, 45.24426553291884, + }; + + constexpr amrex::Real Na22_pf_threshold_T9 = 0.4; + + // Na23 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Na23_pf_array = { + 0.0, 0.0, 0.0, 0.0, 3.999991999914312e-06, + 5.499848755537228e-05, 0.0003019544071791481, 0.0010184811719273939, 0.002532789778269521, 0.0051397687298581594, + 0.00904794362623629, 0.048651106882368046, 0.11044327651595648, 0.1779034781081781, 0.24236561796080108, + 0.30116033125824904, 0.3543724953370972, 0.4030421751754107, 0.448366858436239, 0.532983123231784, + 0.6140650114215304, 0.694670020450467, 0.7762807987518328, 0.8596920201952545, 1.0331844833456545, + 1.2237754316221157, 1.430311246536665, 1.6620303625532709, 1.9213246735826988, 2.2082744135228043, + 2.517696472610991, 2.856470206220483, 3.2068032436339315, 3.572345637857985, 4.519612297626445, + 5.488937726156687, 6.455198563340122, 7.414572881350589, 8.368693183097793, 9.314700387300425, + 10.254144424149297, 11.185809323273041, 12.117241431823558, 13.043320170063875, 13.963930563082547, + 14.89051298099325, 15.812928264165519, 16.733281290048552, 17.652810017196483, 18.56910074907064, + 19.488833825135767, 20.404437035497793, 21.322102338035116, 22.233987776441353, 23.148068562664704, + 24.062587814890477, 24.974614147978176, 25.888051810869925, 26.798611868035096, 27.707982157064677, + 28.620562309542297, 29.53312864232547, 30.446429835351257, 31.354301996759816, 33.17619856040811, + 35.00251041114282, 36.82726256352523, 38.65455623785285, 40.48419700351726, 42.317825039836244, + 44.15458187499503, 48.753063072832326, + }; + + constexpr amrex::Real Na23_pf_threshold_T9 = 0.3; + + // Mg24 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Mg24_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 9.999994999180668e-07, 0.0001259920626667995, 0.0017764212290928272, 0.008665347199341391, 0.024785291222403763, + 0.05209612203517594, 0.09017063128626053, 0.13704782771330884, 0.19024508258946665, 0.30679917070896673, + 0.42717245621910793, 0.5457138884802113, 0.660894613389287, 0.773014180490088, 0.9932517730102834, + 1.2119409739751128, 1.4398351280479205, 1.682688374173693, 1.9487632180377197, 2.244955980157409, + 2.5726122302071057, 2.9338568698359038, 3.3214324131932926, 3.7376696182833684, 4.844187086458591, + 5.983936280687191, 7.114769448366463, 8.237479288613633, 9.332558004700433, 10.413312675968536, + 11.477298287327077, 12.528156144699286, 13.573438996764546, 14.608503073493935, 15.638445644660779, + 16.660419941783683, 17.68044195585857, 18.698312480550644, 19.707154769790044, 20.71321550109291, + 21.716517609956693, 22.717966150171158, 23.7189981105004, 24.712249883510687, 25.706872458654747, + 26.69707544881567, 27.689290024052525, 28.674825168101663, 29.66048428780214, 30.646556016778717, + 31.629221817597745, 32.607754858349125, 33.592026455551824, 34.56833519715223, 36.53211523753711, + 38.48809518508253, 40.44413824296525, 42.39818954960427, 44.3534327337402, 46.31406612434841, + 48.268729064513316, 53.166471308247374, + }; + + constexpr amrex::Real Mg24_pf_threshold_T9 = 0.9; + + // Mg25 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Mg25_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 3.999991999914312e-06, 2.0999779503135708e-05, 6.899761960959409e-05, 0.00017898398141145229, + 0.00038392629086887384, 0.003959152203459259, 0.013552745250832804, 0.029705393438277498, 0.051854986608935144, + 0.07918818883012882, 0.11090342531148507, 0.14627373801669563, 0.18466796848236594, 0.26849543039773127, + 0.35921940405275893, 0.45488047362389566, 0.5544027952979025, 0.6573365664042267, 0.8712933659434193, + 1.1052568313867783, 1.3609765531356006, 1.6409365794934714, 1.9501867058225735, 2.286455711064162, + 2.6461747973841225, 3.0301337002713233, 3.4307561839036995, 3.8394523125933104, 4.890349128221754, + 5.948034989180646, 6.993932975223189, 8.035926369891792, 9.064157861798101, 10.081633737919603, + 11.092854204472703, 12.100712129872347, 13.102160670086809, 14.100689500197937, 15.101984583801954, + 16.098912831541547, 17.096421773751928, 18.09217667698033, 19.08851011652802, 20.080811770701985, + 21.073922708559582, 22.066130640138965, 23.055409732182, 24.05189252577373, 25.0420863957165, + 26.031533534347616, 27.024051631609655, 28.01628351671919, 29.00473669484158, 29.99187511704657, + 30.984427833754356, 31.97482653778223, 32.96373990919392, 33.957170589083645, 35.93995936852433, + 37.92316665825646, 39.90941442303835, 41.9039565209317, 43.89753677200514, 45.891533107728094, + 47.8922514932784, 52.909215922426306, + }; + + constexpr amrex::Real Mg25_pf_threshold_T9 = 0.5; + + // Al26 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Al26_pf_array = { + 0.0, 0.0, 0.0, 1.2999915500773082e-05, 0.00012399231263549523, + 0.0004938780221697066, 0.0012981570294334805, 0.002695364239974934, 0.004806430584082011, 0.007703253609640361, + 0.0114037296028783, 0.040093409166394374, 0.07828701349794458, 0.11840595271437315, 0.15732677355463054, + 0.19447984435533172, 0.23033920042399608, 0.265669565168513, 0.30120694759654404, 0.3751192962557838, + 0.45500800477640774, 0.5419631791207498, 0.6360835857539417, 0.737097078087148, 0.959350221334602, + 1.2029723039923526, 1.4770487243883548, 1.776645831418007, 2.102913897864978, 2.451005098112319, + 2.8273136219290276, 3.214867803470662, 3.616308761279101, 4.02535169073515, 5.075173815233827, + 6.126869184114185, 7.177782416195197, 8.21878715560148, 9.249561085129464, 10.278493453159584, + 11.300969103046583, 12.319401330837177, 13.339086360915616, 14.357834848789636, 15.373655176010823, + 16.3957273875566, 17.41007933260697, 18.430631074805532, 19.450300161133523, 20.469663078147494, + 21.488733679085982, 22.510012764350922, 23.532668532308907, 24.551907233435507, 25.57529610086603, + 26.595383626421828, 27.6159074781185, 28.63897903632853, 29.66048428780214, 30.685022297606515, + 31.70516297083313, 32.73088754375274, 33.75351392544293, 34.77779329538119, 36.83131115205123, + 38.887763175506365, 40.94730518597019, 43.010972220396184, 45.07619176834679, 47.15031414854902, + 49.22558031881838, 54.436505863251405, + }; + + constexpr amrex::Real Al26_pf_threshold_T9 = 0.2; + + // Al27 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Al27_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.9999980000601777e-06, 7.999968000178667e-06, + 2.3999712004631918e-05, 0.0007467211343664971, 0.0043365834151270505, 0.012613119117341724, 0.025879225360058624, + 0.04352872800982073, 0.06476380825852196, 0.08892620919440149, 0.11555923150247234, 0.17518112447569315, + 0.24246449399152697, 0.31716053166008507, 0.39949532435512003, 0.4899643322825811, 0.6981347220709843, + 0.9439058989071284, 1.2325602611778486, 1.5644405465033646, 1.9329696377795786, 2.33214389523559, + 2.7536607123542622, 3.1945831322991562, 3.648057459593681, 4.107589788972121, 5.267858159063328, + 6.434546518787453, 7.590852123688581, 8.737131611781498, 9.87302834505142, 11.005427631296913, + 12.133501952695338, 13.253391639810733, 14.369395671190711, 15.485102393218122, 16.600521800202614, + 17.709369592764748, 18.819456863909732, 19.92475814072864, 21.03075053669437, 22.13181080700112, + 23.232865099324783, 24.334183749590636, 25.432796038258747, 26.5284008058629, 27.625003043602984, + 28.719583068743155, 29.813695912250036, 30.908165848920724, 31.999202343780375, 33.090606630072706, + 34.182101450971956, 35.275940460887405, 36.36493729085607, 37.45654712699496, 39.63864282273488, + 41.818095230325305, 44.00375898526045, 46.191463802256074, 48.3838457551165, 50.57131415750736, + 52.76587238979039, 58.26772483626426, + }; + + constexpr amrex::Real Al27_pf_threshold_T9 = 0.7; + + // Si28 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Si28_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.999987500074422e-06, 0.00016398655347018683, 0.0012951609168895288, 0.005118876169847203, + 0.013624759981329058, 0.02828128753789161, 0.049683098718023844, 0.07761360594716747, 0.14972690936745123, + 0.23659586188405388, 0.3312766198925985, 0.4296704475287004, 0.5302411173120398, 0.7419373447293773, + 0.9745596399981308, 1.247032293786383, 1.5748464676644813, 1.9615022438151495, 2.3978952727983707, + 2.8791984572980396, 3.391147045808654, 3.919991175077323, 4.461299815568389, 5.8289456176102075, + 7.1853870155804165, 8.525161361065415, 9.836278802842678, 11.131665045558881, 12.409013489526863, + 13.671640187544572, 14.924073177485552, 16.166885815127753, 17.40180342330311, 18.627694913336693, + 19.853381477886412, 21.066855541336487, 22.279302972653397, 23.483275776979333, 24.687881292493728, + 25.88232113616094, 27.077635877743763, 28.267597945000098, 29.453956202625054, 30.636703720335706, + 31.81764095425982, 32.9969971309504, 34.17205111511845, 35.345252260777634, 36.51701543108136, + 37.68722975548234, 38.856264508447, 40.02357332840134, 41.190348268500415, 43.51970360255906, + 45.84713469413964, 48.17276507625157, 50.49670329371618, 52.82019507152954, 55.14438418838886, + 57.46921714004648, 63.288212426803526, + }; + + constexpr amrex::Real Si28_pf_threshold_T9 = 1.0; + + // Si29 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Si29_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 9.999994999180668e-07, 0.00010599438239691326, 0.0012602056072493328, 0.0056748674375023955, 0.01575424757578948, + 0.03316588113645688, 0.058632049727251404, 0.09209410468342157, 0.132964982244445, 0.233337812809919, + 0.3523540221873608, 0.48414380902422144, 0.6252799253292538, 0.774441412442551, 1.0986122886681098, + 1.4586150226995167, 1.8656293177945105, 2.312535423847214, 2.791165107812717, 3.295836866004329, + 3.8110970868381857, 4.333361462692601, 4.859812404361672, 5.384495062789089, 6.688354713946762, + 7.975908360165538, 9.249561085129464, 10.499573020252942, 11.744037185933616, 12.976180867226248, + 14.20077295875492, 15.422946467727702, 16.636889444373487, 17.84975119611667, 19.057257573023918, + 20.262816420505487, 21.46520318167579, 22.66344531129274, 23.85876005287556, 25.052682521347997, + 26.244726754808656, 27.43257017720471, 28.620562309542297, 29.805772837412707, 30.987918238694125, + 32.17218597194073, 33.35460621788093, 34.533763853087144, 35.71434972471492, 36.89015165207416, + 38.071002038979245, 39.24830659622302, 40.42488042636084, 41.603535422702485, 43.956130936271194, + 46.31406612434841, 48.66909769271499, 51.028435602301485, 53.391239555288585, 55.75062224667577, + 58.11851243807758, 64.05383225617646, + }; + + constexpr amrex::Real Si29_pf_threshold_T9 = 0.9; + + // P30 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D P30_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 1.9999980000601777e-06, 1.1999928000476974e-05, 5.199864804680849e-05, 0.00016098704089100344, + 0.0003959216126936291, 0.005918451363559697, 0.023009245302846, 0.05240362773926729, 0.09169729756159335, + 0.13837402313895786, 0.19062945047641852, 0.2473076340133595, 0.30769644203486257, 0.43812072837800836, + 0.5806076238090854, 0.7355325923063368, 0.90380470485907, 1.08604565828615, 1.4906543764441336, + 1.9401794743463283, 2.424802725718295, 2.917770732084279, 3.427514689979529, 3.937690752176724, + 4.448516375942715, 4.955827057601261, 5.4638318050256105, 5.971261839790462, 7.222566018822171, + 8.459564078579602, 9.680344001221918, 10.891168280496956, 12.089538829274222, 13.284482226880764, + 14.473030560881067, 15.660810794120358, 16.8456442582356, 18.033546592528925, 19.218187939836554, + 20.40306057278907, 21.58615579209345, 22.770958680311665, 23.954070232679886, 25.137275517473345, + 26.31797721654825, 27.50091243058153, 28.68184274076031, 29.8642561307878, 31.045463724340724, + 32.225130354557216, 33.40557266147296, 34.587566559080116, 35.7684169459852, 36.945721503228974, + 38.13059413618149, 39.30946101937635, 40.494613764375515, 41.67764339485621, 44.0492213593372, + 46.416344973468824, 48.792541883806116, 51.17566583928417, 53.558293639951756, 55.94513907656354, + 58.33935449240351, 64.3479525254551, + }; + + constexpr amrex::Real P30_pf_threshold_T9 = 0.5; + + // P31 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D P31_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 9.999994999180668e-07, 0.00011099383995581128, 0.0012951609168895288, 0.005682822135497365, 0.015358452840402968, + 0.03151998466160665, 0.05451185924626351, 0.08416190442932753, 0.12008615920783534, 0.20921256415092282, + 0.3197786711794938, 0.45149209313252847, 0.6053334817962622, 0.7824841013751634, 1.205970806988609, + 1.7083778602890038, 2.262804222982201, 2.8449093838194073, 3.4307561839036995, 4.0163830207523885, + 4.596129441335942, 5.170483995038151, 5.736572297479192, 6.295266001439646, 7.668561108015897, + 9.010669176847115, 10.328755287940472, 11.626254150277232, 12.91410843858387, 14.19394699368452, + 15.460315614235666, 16.727861222579214, 17.98989782785991, 19.249232561518514, 20.508834226234224, + 21.767069889119526, 23.020838388116914, 24.275752666154794, 25.527286881679668, 26.777705183215783, + 28.02306320370457, 29.27195769542202, 30.521392873824713, 31.762982541721957, 33.00629952361271, + 34.249760099445766, 35.494287839938124, 36.73377627722479, 37.975984214095874, 39.211605229372594, + 40.457670249183835, 41.69339175182435, 42.937186050336955, 44.180899183312405, 46.661467431501805, + 49.14274431323923, 51.62765096302723, 54.119478055659805, 56.61011538015679, 59.10578639653195, + 61.60592266598343, 67.87357998549544, + }; + + constexpr amrex::Real P31_pf_threshold_T9 = 0.9; + + // S32 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D S32_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.1999928000476974e-05, 0.0001599872013651075, 0.0008965979359162839, + 0.003078257300827377, 0.007778667567807429, 0.01603376935914739, 0.02868269041229125, 0.06934041108806749, + 0.13236245968854618, 0.21875794860165648, 0.32915769331179123, 0.4643325791959468, 0.8109302162163288, + 1.2669476034873244, 1.81319474994812, 2.4336133554004498, 3.086486636822455, 3.756538102587751, + 4.4272389774954295, 5.093750200806762, 5.746203190540153, 6.386879319362645, 7.940939762327791, + 9.433483923290392, 10.883691610153935, 12.296827008798639, 13.688812904918317, 15.062542851750656, + 16.42558035070628, 17.778226677707938, 19.12377825536548, 20.467082431554, 21.80507100729814, + 23.13917961524746, 24.47276991287678, 25.804670201930875, 27.12849429497725, 28.45080094742186, + 29.773437456769773, 31.09048740571468, 32.410144609040074, 33.72233099800625, 35.033472636746794, + 36.34378109088876, 37.65229170412106, 38.960023742737846, 40.265624142497884, 41.56874930661707, + 42.87684292042949, 44.180899183312405, 45.48430588462653, 46.78406975359414, 49.39102383782498, + 51.99450123500761, 54.60039371835652, 57.205091148631375, 59.81381164111807, 62.424439729212814, + 65.03769641288334, 71.57898874156058, + }; + + constexpr amrex::Real S32_pf_threshold_T9 = 1.5; + + // S33 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D S33_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 2.9999954999842446e-06, 9.999950000398841e-06, + 2.8999579508186245e-05, 0.0007467211343664971, 0.0038097337398404945, 0.01022059135921024, 0.020067298150111938, + 0.033246170293546144, 0.049840088995890784, 0.07015086741745234, 0.09461448331817887, 0.15797763340443732, + 0.2438179553653309, 0.35560937642326057, 0.49601610214447456, 0.6663451948054367, 1.091923300517313, + 1.6074359097634274, 2.182674796321488, 2.785011242238338, 3.3945083935113587, 4.005513348515485, + 4.61512051684126, 5.214935757608986, 5.811140992976701, 6.400257445308821, 7.847762537473608, + 9.268609280100158, 10.657259354912508, 12.031719258385396, 13.389332408258568, 14.739769459487606, + 16.084538867429476, 17.4264284706085, 18.764270448342444, 20.10150865247314, 21.436215644802537, + 22.772248171141538, 24.10426051129105, 25.441764708241507, 26.76827115098242, 28.09475513216069, + 29.424445864475665, 30.753386040415904, 32.077195570426184, 33.402462239058565, 34.72109795170464, + 36.04728838875482, 37.3719897389669, 38.6929609574888, 40.01523994684219, 41.33560011318554, + 42.65847264786794, 43.980228487850255, 45.30092556648433, 46.622681406466654, 49.270577684749114, + 51.91816991681421, 54.568895051297154, 57.22354447567225, 59.87716274869835, 62.541361067271716, + 65.21431994856266, 71.9048664117504, + }; + + constexpr amrex::Real S33_pf_threshold_T9 = 0.7; + + // Cl34 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Cl34_pf_array = { + 0.0, 8.399647219752854e-05, 0.0014309756657812272, 0.024008476183393877, 0.09541108380425417, + 0.21039219725565883, 0.3455954928691866, 0.4821378360811084, 0.6103295429939214, 0.7267337826442105, + 0.8310273535170856, 1.2112854019918935, 1.451001930468008, 1.620461726304086, 1.7503536237444364, + 1.8560796852888066, 1.946477559476141, 2.027138790593848, 2.1018603516269967, 2.2436505733998957, + 2.386405609599034, 2.538598590122878, 2.7049863121845568, 2.887739630218716, 3.299533727885655, + 3.770459441106359, 4.282206299391671, 4.820281565605037, 5.37989735354046, 5.950642552587727, + 6.525029657843462, 7.098375638590786, 7.67786350067821, 8.258422462458876, 9.692766521220475, + 11.112447898373103, 12.520883385370206, 13.919870573288517, 15.306164934408407, 16.694709015262312, + 18.076780991502357, 19.460957455607513, 20.84548346967066, 22.225118538700574, 23.608066549793122, + 24.98875865536434, 26.36871273458965, 27.753238748652798, 29.128409524554026, 30.50458575550833, + 31.885214379092545, 33.26223289774991, 34.63408657471501, 36.01353940401818, 37.38948289641442, + 38.76268616148743, 40.13719835390906, 41.51419032236664, 42.886366801940746, 44.261940393315534, + 45.63618641591925, 47.01105208121552, 48.3838457551165, 49.76527392658522, 52.51940058598527, + 55.281844859153274, 58.040861503847516, 60.80721967633666, 63.578342480893944, 66.3548964363298, + 69.13582169794535, 76.11633633120991, + }; + + constexpr amrex::Real Cl34_pf_threshold_T9 = 0.01; + + // Cl35 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Cl35_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.1999118024792734e-05, 0.0004768862716642343, 0.002171640281399847, 0.006214649003101918, + 0.013601084477779782, 0.025115937609836814, 0.04134825602037712, 0.06275411753599432, 0.12260959129668093, + 0.207735860122419, 0.3215376980728771, 0.4673551250528115, 0.6472901355876193, 1.1052568313867783, + 1.665818245870208, 2.2874714551839976, 2.9338568698359038, 3.5890591188317256, 4.241326752570746, + 4.890349128221754, 5.529429087511423, 6.1675164908883415, 6.796823718274855, 8.349957272040324, + 9.87302834505142, 11.379394072345706, 12.86876061860541, 14.346138809026444, 15.821036416693943, + 17.290577788192884, 18.75715298057358, 20.21908475589909, 21.678777281973847, 23.13917961524746, + 24.594466847854303, 26.051142005735993, 27.502050734631588, 28.952776955910867, 30.40360983816833, + 31.8475833108749, 33.29050333168817, 34.73762725365585, 36.17582947437776, 37.6160886554571, + 39.05620766659077, 40.494613764375515, 41.935111688711494, 43.36931940552728, 44.80690706103472, + 46.242322219489566, 47.677013121471305, 49.11509278190872, 50.55039980135849, 53.42319115509519, + 56.29877911680712, 59.176063239947915, 62.0555083644371, 64.93611662006542, 67.82578932165909, + 70.71848936931484, 77.9704389310121, + }; + + constexpr amrex::Real Cl35_pf_threshold_T9 = 1.0; + + // Ar36 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ar36_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 9.999994999180668e-07, 5.399854205248437e-05, 0.0005328580059528724, 0.0024460060865663185, + 0.007262563624929949, 0.016429296950877147, 0.03102568700488373, 0.051697362740936774, 0.11229958453583105, + 0.1990262531987242, 0.3122512627917935, 0.45265144715484346, 0.6210027409523153, 1.0438040521731147, + 1.5769147207285403, 2.2071749081893874, 2.9069010598473755, 3.6402142821326553, 4.388257184424518, + 5.135798437050262, 5.872117789475416, 6.5998704992128365, 7.313220387090301, 9.047821442478408, + 10.72326738402944, 12.354492650648448, 13.955272500339433, 15.534699334357494, 17.10017412337048, + 18.65179246491575, 20.200704956962, 21.74211315714566, 23.280493148314036, 24.809242149497994, + 26.336393943334482, 27.862132836891934, 29.378480326260025, 30.892956430257197, 32.40170574039421, + 33.91141695488874, 35.41840314241325, 36.91832252904086, 38.41827620863327, 39.91405480259485, + 41.40882980670881, 42.900484683486525, 44.39097065305926, 45.88091353890063, 47.368110093536636, + 48.85506224078745, 50.34216130102931, 51.82625340542532, 53.31011401047622, 56.27727291158615, + 59.243591299933854, 62.209018223992516, 65.17548011524639, 68.14614842013717, 71.11747357333893, + 74.09483262663629, 81.54213613050304, + }; + + constexpr amrex::Real Ar36_pf_threshold_T9 = 1.0; + + // Ar37 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ar37_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 1.6999855501571383e-05, 0.0003199488109201438, 0.0019291380161085153, 0.006550498561556142, + 0.015993420687572764, 0.03177091681774753, 0.05500509711667123, 0.08649691134153642, 0.17644851083955373, + 0.30471247833763737, 0.4723465075617039, 0.6779228767281616, 0.9174476623719025, 1.472472057360943, + 2.0943301541735866, 2.747270914255491, 3.407841924380824, 4.074141854904581, 4.736198448394496, + 5.3981627015177525, 6.056784013228625, 6.71174039505618, 7.358830898342354, 8.968268810776454, + 10.553205175168737, 12.117241431823558, 13.670484785914017, 15.214227439082721, 16.75467248002987, + 18.286005840625762, 19.816925435925423, 21.34384232467152, 22.86919711989508, 24.39194258374283, + 25.910651642787165, 27.43134992079948, 28.947429349584272, 30.458334737857577, 31.97092282430176, + 33.48034589587541, 34.9898520142709, 36.49322144641584, 37.99824268469682, 39.50162102517059, + 41.00180585183136, 42.50084370366435, 44.00375898526045, 45.50178884740688, 46.99949125881444, + 48.50270695799323, 49.99909200914635, 51.49843923154722, 52.998677852016336, 55.999206297833815, + 58.999711850140464, 62.00374292650915, 65.01470689465864, 68.02486943304166, 71.04326556617286, + 74.0679853766001, 81.64479028456313, + }; + + constexpr amrex::Real Ar37_pf_threshold_T9 = 1.0; + + // K38 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D K38_pf_array = { + 0.0, 5.99998200002249e-06, 7.399726213497465e-05, 0.000920576139730191, 0.003245726924920465, + 0.006912056602512853, 0.011464036108238488, 0.016520777324712164, 0.021858355974565473, 0.027366108783188067, + 0.03299464055608423, 0.06242723143316346, 0.09256733072150802, 0.12145273849731941, 0.14817083614722878, + 0.17280558992442463, 0.19603624569779293, 0.21889775064540448, 0.24265044861207402, 0.2986316563605269, + 0.376196943627374, 0.4867826950853164, 0.6382452777065629, 0.8327799841622691, 1.3297240096314962, + 1.925707441737794, 2.5649493574615367, 3.2188758248682006, 3.8753590210565547, 4.530446639792155, + 5.181783550292085, 5.834810737062605, 6.483107351457199, 7.1308988302963465, 8.733916174927524, + 10.325481962595504, 11.904967552746252, 13.478638241321722, 15.048070819142122, 16.612791892794426, + 18.177334485320635, 19.739766355378805, 21.305481456799075, 22.865682177787637, 24.424567811058903, + 25.985956025851298, 27.54000171754138, 29.094276518184568, 30.646556016778717, 32.19952731754505, + 33.749118313969895, 35.29958222394445, 36.841361487904734, 38.39104939593306, 39.93693909642844, + 41.47609047613437, 43.02344639462136, 44.56448158017106, 46.10997076800489, 47.65108943646151, + 49.19585413855318, 50.73383308700513, 52.280212863472094, 53.82234709401009, 56.910700857444475, + 59.99824068025159, 63.09405641236256, 66.1933618910003, 69.30069634113558, 72.4061794786487, + 75.51849933045429, 83.32484576421118, + }; + + constexpr amrex::Real K38_pf_threshold_T9 = 0.01; + + // K39 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D K39_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 8.999959500168733e-06, 7.899687966427683e-05, + 0.00037492970507319685, 0.001242228115069206, 0.00324074311482773, 0.007155339392150637, 0.02497549940339207, + 0.06515645517700097, 0.14035828626592, 0.26283492292119165, 0.44048405748466574, 0.9516578757114463, + 1.6154199841116479, 2.341805806147327, 3.0819099697950434, 3.822098297900159, 4.552823705615882, + 5.278114659230517, 5.991464547107982, 6.70073110954781, 7.402451520818244, 9.137769679141348, + 10.847393451443256, 12.535376392672774, 14.214286677921642, 15.88237331743725, 17.543610725231492, + 19.200005620753362, 20.854294099352817, 22.49991166836442, 24.144265845904748, 25.785860869973376, + 27.419064754004904, 29.051716903765772, 30.680294156410568, 32.30384995039046, 33.9262871173682, + 35.546734315310665, 37.163444987073845, 38.77433112568431, 40.38521516996841, 41.99465308240251, + 43.602934256708785, 45.20773178958638, 46.81250768891467, 48.412555860998935, 50.02010519874517, + 51.62004636364201, 53.221821403330544, 54.82353726967073, 56.42519304166278, 59.626413931292255, + 62.82731751375603, 66.03472890873353, 69.24306722829894, 72.45172149909561, 75.66510280464617, + 78.88122000707529, 86.95005212346398, + }; + + constexpr amrex::Real K39_pf_threshold_T9 = 2.0; + + // Ca40 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ca40_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 7.999968000178667e-06, + 5.999820007194575e-05, 0.00028595910979622156, 0.0009795201135002361, 0.0026554711136550003, 0.012259543755687751, + 0.03788039224746407, 0.09067673468466741, 0.18213403921363208, 0.3217356125766328, 0.7608058290337602, + 1.3962446919730587, 2.1610215286722587, 2.990719731730447, 3.8437441646748516, 4.6913478822291435, + 5.53338948872752, 6.359573868672378, 7.170119543449628, 7.965545573129992, 9.903487552536127, + 11.782952602183288, 13.619495674038317, 15.430930542075922, 17.220035729719104, 18.99729410825636, + 20.76248655009969, 22.521669848893136, 24.270005523899226, 26.011532867640945, 27.74434980123555, + 29.476321352084632, 31.197732936068277, 32.914224844666535, 34.624954091151736, 36.333863654231415, + 38.035283956377164, 39.731733245800896, 41.42836770326515, 43.11800497724637, 44.80690706103472, + 46.489956790812066, 48.17156531605966, 49.85167536150043, 51.528165411812424, 53.206317216794574, + 54.876379751045114, 56.54851625769478, 58.222147327767935, 59.88701504514137, 63.22758780498709, + 66.56301133490368, 69.89733262131467, 73.23330598017212, 76.56752368865617, 79.90925964509692, + 83.25073779205746, 91.61564336892684, + }; + + constexpr amrex::Real Ca40_pf_threshold_T9 = 2.5; + + // Ca41 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ca41_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.1999928000476974e-05, 0.00012499218815091137, 0.000638795926430769, + 0.002145696346242404, 0.005526699621766927, 0.011894973462942658, 0.02251561049362153, 0.06185868357830669, + 0.133712376245999, 0.24587600013576424, 0.40222252327430746, 0.6022433286186063, 1.1118575154181303, + 1.7316555451583497, 2.4159137783010487, 3.126760535960395, 3.8522730010223722, 4.58700621536042, + 5.3230099791384085, 6.054439346269371, 6.785587645007929, 7.512071245835466, 9.314700387300425, + 11.09133097493218, 12.853175887588712, 14.603967918328545, 16.34123920227253, 18.07959789477347, + 19.809471985270843, 21.538630650230605, 23.256962650903844, 24.97745910011041, 26.691973396931775, + 28.40112933762462, 30.10755951604603, 31.813071258569753, 33.51434350441683, 35.21172086815311, + 36.899630396028705, 38.59576517058902, 40.28497958545084, 41.97126020282781, 43.657001477979065, + 45.3403907086933, 47.022480777039135, 48.704943824488126, 50.38375012474855, 52.062969034285075, + 53.74335868269146, 55.41904598066676, 57.101003302569445, 58.779540069215415, 62.13830684374786, + 65.49842419966656, 68.86312117910919, 72.23028881218502, 75.60111509597088, 78.97602780053396, + 82.35862785838052, 90.83755551171781, + }; + + constexpr amrex::Real Ca41_pf_threshold_T9 = 1.5; + + // Sc42 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Sc42_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 1.0999939500426909e-05, 0.00012199255860518277, 0.0006667776543641723, 0.0023861508763020852, 0.006421339002625417, + 0.014143507385664571, 0.1433849366157757, 0.41213415383789004, 0.7212029120087621, 1.0089257001252563, + 1.2615049316596305, 1.4822477431162377, 1.6777343014334234, 1.8540033283914306, 2.167172961459759, + 2.4490253811445304, 2.716545216071, 2.9808034410014246, 3.249123632409516, 3.8110970868381857, + 4.423648309364701, 5.075173815233827, 5.765191102784844, 6.4692503167957724, 7.1853870155804165, + 7.904703913873747, 8.626944055375356, 9.350102314351341, 10.06475570013225, 11.84939770159144, + 13.619495674038317, 15.375758226207603, 17.126053571358298, 18.87175636331258, 20.617905321288585, + 22.362262551622056, 24.10426051129105, 25.84722981634967, 27.583929508394696, 29.321116931380104, + 31.0552837705217, 32.790076415143076, 34.519593575493914, 36.24715425519969, 37.975984214095874, + 39.69783169412521, 41.42223898132378, 43.14398046364963, 44.86425835750619, 46.58233011094308, + 48.2998307670789, 50.01821305059313, 51.73528162721959, 53.45415338069916, 55.16773155238585, + 56.88340871515647, 58.60136420980116, 60.318288037205406, 62.03512260751263, 65.47301448414119, + 68.91267814663114, 72.35846400560902, 75.80618140290608, 79.26245280179569, 82.72108808304583, + 86.18518963439344, 94.88222299175224, + }; + + constexpr amrex::Real Sc42_pf_threshold_T9 = 0.4; + + // Sc43 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Sc43_pf_array = { + 0.0, 3.999991999914312e-06, 7.399726213497465e-05, 0.001402016715091746, 0.006077494560027172, + 0.014618625311574956, 0.02619392408247513, 0.039701366851552046, 0.05424762604898671, 0.06923404240290812, + 0.08429886812818674, 0.15680885802481764, 0.22576092300652262, 0.2958459074810483, 0.3697667707656917, + 0.44823145115712454, 0.5308782198173778, 0.6169230478401032, 0.7055430335362739, 0.8880710765749581, + 1.0759156577802853, 1.2697417244621174, 1.4721694886558687, 1.6865639399592258, 2.1598687907924505, + 2.70805020110221, 3.32862668882732, 4.000033882750859, 4.709530201312334, 5.43372200355424, + 6.1675164908883415, 6.907755278982137, 7.649692623711514, 8.387084506069217, 10.221941283654663, + 12.043553716032399, 13.854731271117556, 15.66238932641341, 17.466168799258014, 19.266549011529975, + 21.066855541336487, 22.863332000442682, 24.660956589123135, 26.456607113844157, 28.246206755018783, + 30.037966224246837, 31.826718172410935, 33.61243532718303, 35.39319172306675, 37.17783372452595, + 38.95157468825132, 40.727040517993274, 42.50084370366435, 44.27384529582185, 46.04467724494395, + 47.81300212162426, 49.580999244170386, 51.35001922642895, 53.116460887672716, 54.88370579113718, + 56.64833659297699, 58.41477825422075, 60.18202315768522, 61.94790317892546, 65.48398351551175, + 69.01992367698473, 72.55879287915707, 76.10752570152776, 79.65143053579483, 83.20787408762568, + 86.76634552489736, 95.69246283859356, + }; + + constexpr amrex::Real Sc43_pf_threshold_T9 = 0.01; + + // Ti44 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ti44_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 9.999994999180668e-07, 3.999991999914312e-06, + 1.6999855501571383e-05, 0.001148340404701717, 0.009309531525720607, 0.03254753540924965, 0.07466488847560604, + 0.13484203335959946, 0.21026254622742566, 0.2980372718296754, 0.3958328666591973, 0.6142679208183114, + 0.8527628998182619, 1.1003700761873567, 1.3495302680031462, 1.5974157347878484, 2.0992441689760155, + 2.653241964607215, 3.3178157727231046, 4.096009841541162, 4.955827057601261, 5.8522024797744745, + 6.754604099487962, 7.649692623711514, 8.52912176228151, 9.392661928770137, 11.50388472031808, + 13.551545012129809, 15.559479363355981, 17.543610725231492, 19.509242696766975, 21.46520318167579, + 23.4111133307311, 25.348238650230684, 27.28570993064013, 29.214115053023047, 31.136578512914948, + 33.05155611520083, 34.96404413031503, 36.87092029014627, 38.768525594138985, 40.66345978580489, + 42.5550942934141, 44.43725140562327, 46.32172899709398, 48.1999695924906, 50.07347572926818, + 51.94610469414577, 53.81387246701912, 55.680752566715285, 57.54442461753362, 59.40517695824863, + 61.265929298963634, 63.12530895586667, 64.97920020620172, 66.8332366049513, 70.54542713793369, + 74.2537025223952, 77.95660745186365, 81.66206187107178, 85.36960174790313, 89.07514825450228, + 92.78650056446827, 102.07454992077177, + }; + + constexpr amrex::Real Ti44_pf_threshold_T9 = 0.7; + + // Ti45 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ti45_pf_array = { + 0.014448121403123636, 0.0620325713666056, 0.1260791938394823, 0.2487107082084761, 0.3432293557843727, + 0.41344650518308595, 0.4666969180975651, 0.5083676053122761, 0.5420143590805497, 0.5699620799895669, + 0.5937510646762253, 0.6778512926408168, 0.7349702738136049, 0.7820098012733558, 0.8257255567084931, + 0.869456533555718, 0.914943424663271, 0.9631151557176222, 1.01451593160384, 1.1285380138764503, + 1.2600534709382594, 1.4125961660703341, 1.5900047048940393, 1.7956678216588073, 2.295560478057081, + 2.91235066461494, 3.6136169696133895, 4.368181227851829, 5.147494476813453, 5.942799375126701, + 6.739336627357174, 7.533693709848633, 8.32845106681936, 9.116029692504942, 11.069758489678053, + 13.001325049027272, 14.920767389351052, 16.831045458814444, 18.735491483792398, 20.63988422800736, + 22.542964674863708, 24.444128336913398, 26.343666702663562, 28.24078668754944, 30.14062037830692, + 32.02793636309618, 33.91701921043741, 35.80290312205637, 37.68292867358295, 39.56265691575696, + 41.43950705895586, 43.31370778240563, 45.18420129217619, 47.05233374018882, 48.91960076192502, + 50.78790030827541, 52.65021088849543, 54.51338234136689, 56.37718382247642, 58.23757179809357, + 60.09832413880857, 61.95907647952358, 63.82037736660451, 65.68134294967025, 69.39963628899048, + 73.12585341354206, 76.85240855648689, 80.58244608309434, 84.31617168202825, 88.05784932170916, + 91.8009463617279, 101.18931401335983, + }; + + constexpr amrex::Real Ti45_pf_threshold_T9 = -1.0; + + // V46 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D V46_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 9.999994999180668e-07, 1.3999902000873147e-05, 7.399726213497465e-05, 0.000279960807315855, + 0.0008196639836764198, 0.021764427197947987, 0.11724689195703267, 0.318424639786295, 0.5980565266580462, + 0.9067122038937319, 1.2094864760629076, 1.4908631384356164, 1.7470478016727253, 2.191587273108433, + 2.5693851968703596, 2.907210793295783, 3.2258881410095355, 3.5406624973799445, 4.194189897191817, + 4.912654885736052, 5.683579767338681, 6.492239835020471, 7.31986492980897, 8.146129510025405, + 8.97335141383992, 9.792555991828847, 10.60905725309463, 11.416414564589385, 13.407542319637992, + 15.369435760468116, 17.31504384034729, 19.25358986688747, 21.186999853178552, 23.121161109744783, + 25.059248533118886, 26.996142843492578, 28.93121277799503, 30.86577028995304, 32.8015051109667, + 34.73762725365585, 36.66462430940468, 38.59229896261253, 40.517662159811806, 42.43978344690311, + 44.35888233850776, 46.27484541119512, 48.19411820072214, 50.10869063555925, 52.02040941986628, + 53.934016778861185, 55.84425785170976, 57.75524768445979, 59.66018824841086, 61.56831751880511, + 63.47542396889167, 65.3846653143099, 67.28779132325599, 69.19977042254563, 73.01329232186683, + 76.83117633638112, 80.64874716291557, 84.47410178569805, 88.30023511924577, 92.13296252200337, + 95.97460473066972, 105.59733065359863, + }; + + constexpr amrex::Real V46_pf_threshold_T9 = 0.5; + + // V47 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D V47_pf_array = { + 5.799831806492598e-05, 0.0017464740260096463, 0.009732485344379859, 0.056357648868795907, 0.13811537012749586, + 0.23671188375470134, 0.33785770498795076, 0.4340856062023528, 0.5224146112876673, 0.6021781642551665, + 0.6737563884480131, 0.9374767156169274, 1.1057414821365488, 1.2270658944596067, 1.3241582851318665, + 1.4082520176128814, 1.4853425458705931, 1.5589413532003664, 1.6313402944858075, 1.7788893365658949, + 1.9381601955952519, 2.1170521853281072, 2.3219262412761434, 2.557256768298108, 3.122364924487357, + 3.8022081394209395, 4.562262684976814, 5.365976015021851, 6.1903154058531475, 7.02108396428914, + 7.855544677915663, 8.68270762989381, 9.503009985939002, 10.325481962595504, 12.354492650648448, + 14.363631966473962, 16.35711255142882, 18.34595719775643, 20.333181830876548, 22.32265341352701, + 24.309558702285248, 26.299214940092728, 28.28854111884534, 30.270078445543806, 32.25599392921282, + 34.23767130212676, 36.215872955818604, 38.19202867138147, 40.16279390109803, 42.13466631262922, + 44.09977363850004, 46.06165219073408, 48.02717081117777, 49.987441391926374, 51.94610469414577, + 53.90336303777018, 55.8608787329458, 57.81148740278267, 59.76739208256298, 61.72038051520189, + 63.6716502125934, 65.62611419172246, 67.57696928229936, 69.5286284091816, 73.43297874269807, + 77.34114322243869, 81.24799825770839, 85.16312524907413, 89.08132747086823, 93.0035650697061, + 96.93171745706412, 106.77757589676362, + }; + + constexpr amrex::Real V47_pf_threshold_T9 = -1.0; + + // Cr48 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Cr48_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 1.9999980000601777e-06, 1.8999819502277547e-05, 9.099585975123644e-05, 0.0003069528851426514, + 0.0008086729358847522, 0.01474081832149851, 0.06183142275093884, 0.143112843568674, 0.24629820135844444, + 0.35917332039555183, 0.47390849532294727, 0.5864963884088562, 0.6953427684917824, 0.9015222121689769, + 1.0969652664046097, 1.2900003975589762, 1.4908676419897087, 1.7117063726116648, 2.263844264677615, + 3.0155349008501706, 3.929862923556477, 4.927253685157205, 5.934894195619588, 6.937314081223682, + 7.9157131993821155, 8.87626525995469, 9.820105943597078, 10.745054738214346, 13.005829561148378, + 15.211755249937333, 17.385043254445645, 19.535822334571687, 21.678777281973847, 23.809752473768867, + 25.938201594555398, 28.05628885133289, 30.172623109393093, 32.28498146608607, 34.38911562035628, + 36.4875396129484, 38.58007173604297, 40.66782660497123, 42.74944442607366, 44.827526348237456, + 46.901852789250526, 48.96947259196519, 51.028435602301485, 53.090485401269454, 55.14550841560114, + 57.19790204505891, 59.24731569902484, 61.29272749211836, 63.33917887039555, 65.38064116401017, + 67.42207093888587, 69.45598922554161, 71.49346656812241, 73.53190008607488, 77.60072805291516, + 81.66888783614219, 85.73214181129426, 89.79881662409711, 93.86470398150517, 97.93528619704534, + 102.00689127229795, 112.19931011668629, + }; + + constexpr amrex::Real Cr48_pf_threshold_T9 = 0.5; + + // Cr49 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Cr49_pf_array = { + 0.0, 0.0, 0.0, 3.599935201547656e-05, 0.0004998750416509929, + 0.0024190716852989735, 0.0069100703769868176, 0.014591031275038784, 0.02549326759035296, 0.039243789810090184, + 0.055277646304969466, 0.15107681749220161, 0.24582360347740795, 0.32948934142970654, 0.40412020413010924, + 0.47317422259826797, 0.5392801271735718, 0.6041793454991995, 0.6690547753091058, 0.8024431919853905, + 0.947119019240504, 1.1122982077726729, 1.3080119573685711, 1.5426652173876227, 2.1377104498038118, + 2.8791984572980396, 3.7062280924485496, 4.5736795188967205, 5.455321115357702, 6.343880434126331, + 7.22983877815125, 8.116715624819111, 9.002085433155724, 9.883284845218608, 12.083905011555967, + 14.27293540500315, 16.44739939810092, 18.627694913336693, 20.790924485420227, 22.956500851805664, + 25.114004412222314, 27.265737797453216, 29.411045328938183, 31.551012291005872, 33.683110284852965, + 35.808536939774626, 37.92992344071934, 40.04410793084305, 42.15456746694652, 44.25593436925532, + 46.359186559628874, 48.44959713267929, 50.54482254206038, 52.63234099716586, 54.71731505641542, + 56.80105767999465, 58.881035558506866, 60.959135718362504, 63.03689799852262, 65.10895943290483, + 67.18043280493549, 69.25987434661532, 71.32884458842787, 73.40036006483528, 77.54345268685006, + 81.68575164219419, 85.83222526985124, 89.97477193389122, 94.12891691941611, 98.2834203734144, + 102.44514620322911, 112.86589026986152, + }; + + constexpr amrex::Real Cr49_pf_threshold_T9 = 0.2; + + // Mn50 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Mn50_pf_array = { + 0.0, 0.0, 1.8999819502277547e-05, 0.0015627782257373031, 0.014220408999946248, + 0.05267593809505302, 0.1232763641057352, 0.2208833990933436, 0.33492318030990115, 0.4553822560403851, + 0.5752596394430565, 1.0834245364365287, 1.4428200053589308, 1.709907125149808, 1.9206037695771465, + 2.0949654203296024, 2.2453021066893872, 2.379787864170373, 2.5041471092935526, 2.738134172861465, + 2.970003714556386, 3.213558151069494, 3.4772103500625318, 3.765413459638891, 4.415219602029645, + 5.153291594497779, 5.950642552587727, 6.785587645007929, 7.640123172695364, 8.503094267036737, + 9.375854810453756, 10.243524855321837, 11.116915515632819, 11.9891596439666, 14.17318500223609, + 16.35711255142882, 18.534009429259367, 20.71321550109291, 22.89003120679792, 25.06577171345801, + 27.239458912989374, 29.40935756482446, 31.574542788416064, 33.73357971054212, 35.88944357838742, + 38.041326270833125, 40.18775063307189, 42.33029921406142, 44.46695656003718, 46.5998232683906, + 48.732723388595204, 50.85572290461417, 52.97925976615923, 55.10421814666353, 57.22354447567225, + 59.33957967576281, 61.45440472133197, 63.568514391957684, 65.68134294967025, 67.79019837655639, + 69.90172823278772, 72.01140965965728, 74.12097790674062, 76.23216814673503, 80.45006610107485, + 84.67139979668156, 88.8944782257468, 93.12225103996107, 97.35567714780846, 101.5913758283363, + 105.83226647100042, 116.4668838388409, + }; + + constexpr amrex::Real Mn50_pf_threshold_T9 = 0.15; + + // Mn51 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Mn51_pf_array = { + 0.0, 0.0, 9.999994999180668e-07, 0.00013899034039500225, 0.001371059667992007, + 0.005417299897942013, 0.013501443923597083, 0.02583439952789853, 0.0418873468309038, 0.060801547340661864, + 0.08168044277606486, 0.19327880627694072, 0.29229193070917964, 0.3745845060072903, 0.44569620808461924, + 0.510841423641172, 0.5736229423899079, 0.6364096193255848, 0.7008211601140627, 0.8391137474239475, + 0.9961154465581769, 1.1782339846517378, 1.391004998624912, 1.6384188778571893, 2.2375130962503307, + 2.9652730660692823, 3.7773481021015445, 4.6443908991413725, 5.53338948872752, 6.434546518787453, + 7.346010209913293, 8.25582842728183, 9.170559501964338, 10.085809109330082, 12.371587084007746, + 14.652758082497977, 16.933460464242515, 19.209138104316636, 21.479387816667746, 23.743690723090772, + 26.001380496176928, 28.251597603653657, 30.498920017972655, 32.73088754375274, 34.96404413031503, + 37.18495119229481, 39.39858879927236, 41.61204611237039, 43.81677541536068, 46.01814507635207, + 48.21272338855317, 50.40326928707009, 52.58984168364859, 54.77265188881117, 56.95213804730865, + 59.12906787135451, 61.30229694313451, 63.47542396889167, 65.64486474106785, 67.81524440848247, + 69.98177094046126, 72.1502461045115, 74.31399475265133, 76.48000431063961, 80.80558963440855, + 85.13695944443101, 89.46813918838527, 93.80085250951863, 98.13648994156063, 102.47689490154369, + 106.82313242836598, 117.7094714792946, + }; + + constexpr amrex::Real Mn51_pf_threshold_T9 = 0.15; + + // Mn52 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Mn52_pf_array = { + 0.0, 0.0, 0.0, 0.0, 6.9999755002045995e-06, + 6.099813957574563e-05, 0.00026496489370193545, 0.0007667060058193819, 0.0017175242105127281, 0.003257687967804059, + 0.0055078041609035976, 0.031055739524086995, 0.0867142495183009, 0.17168182168960952, 0.27652430544087403, + 0.3908359552851754, 0.5072650925912114, 0.6218155047726106, 0.7328850676480372, 0.9446355937046071, + 1.1480942769640976, 1.3521614033615421, 1.565582363001976, 1.7958074318279333, 2.322387720290225, + 2.9601050959108397, 3.6888794541139363, 4.483002552013883, 5.3230099791384085, 6.186208623900494, + 7.064759027791802, 7.962067308753666, 8.863615758890619, 9.769956159911606, 12.05524975579559, + 14.346138809026444, 16.64872390202049, 18.945409272887346, 21.242059630361577, 23.532668532308907, + 25.817016037753174, 28.09475513216069, 30.36538862534813, 32.62823338969266, 34.88943326652385, + 37.13403110186755, 39.38296348136927, 41.62048498101626, 43.84442694669119, 46.071504487177094, + 48.29559795652628, 50.5130016754493, 52.72626325169534, 54.93631209176779, 57.14303283481309, + 59.34801854440868, 61.54990079201888, 63.748776215788624, 65.94714561294077, 68.14614842013717, + 70.34167951696705, 72.5370190796075, 74.73004197009003, 76.92531532729498, 81.31318423759309, + 85.70246604314814, 90.10092321921812, 94.49216650899693, 98.89350095527573, 103.29887495394661, + 107.70900568985346, 118.76420576179066, + }; + + constexpr amrex::Real Mn52_pf_threshold_T9 = 0.3; + + // Fe52 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Fe52_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 3.999991999914312e-06, 2.1999758003515767e-05, 8.699621571943491e-05, + 0.00026096594542543384, 0.006963697081509575, 0.035510955889664755, 0.09259923578662213, 0.17220724583011637, + 0.26453344854718897, 0.3618510248890247, 0.45961295770683647, 0.5556743162453767, 0.7407490199034046, + 0.9195135330669838, 1.1002529420599954, 1.2949715212992456, 1.5184586008666647, 2.1077860146889784, + 2.9231615807191558, 3.893859034800475, 4.9344739331306915, 5.988961416889864, 7.038783541388542, + 8.06777619577889, 9.08704215563169, 10.094107912144779, 11.094375117313408, 13.559327152571864, + 15.990262279448435, 18.397412117013012, 20.790924485420227, 23.165612872315616, 25.527286881679668, + 27.88566333430213, 30.226275822885412, 32.55827480108575, 34.88236609930076, 37.1920183595179, + 39.494603452511946, 41.7901213782829, 44.07842051402947, 46.359186559628874, 48.63191868947324, + 50.895888946339504, 53.15830799760822, 55.41046223697537, 57.65993750465547, 59.90643313099847, + 62.14550481827019, 64.3824578963053, 66.61597196533687, 68.84562073247407, 71.07361272256216, + 73.2999973546708, 75.52327260920696, 77.74488863966732, 79.96498972270547, 84.40157534162978, + 88.83586272291235, 93.26655452956751, 97.69811509936366, 102.1291089050222, 106.56601751978464, + 111.00031864271057, 122.10466857715824, + }; + + constexpr amrex::Real Fe52_pf_threshold_T9 = 0.6; + + // Fe53 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Fe53_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 2.9999954999842446e-06, 1.3999902000873147e-05, 4.6998895534514674e-05, + 0.00012399231263549523, 0.0022973590486834584, 0.010342333218121334, 0.026671141814813795, 0.05206005035504811, + 0.08642995799836133, 0.12936899184122008, 0.18043644775855625, 0.23931764264461317, 0.3801124277209676, + 0.5523799580600001, 0.7580918692003275, 0.9991071891450825, 1.2759989109005887, 1.9286186519452522, + 2.6946271807700692, 3.5263605246161616, 4.409155302062135, 5.318119993844216, 6.2422232654551655, + 7.177782416195197, 8.122668023346407, 9.073374516903025, 10.030120203469494, 12.425208175446844, + 14.830741237693333, 17.236510566922608, 19.635593488316637, 22.02345749901289, 24.402094955206845, + 26.770638015992688, 29.128409524554026, 31.4747652806034, 33.81103776958112, 36.13816397149128, + 38.45479142160837, 40.76531306419815, 43.06591991718009, 45.36055268198364, 47.649067191080746, + 49.931201673603496, 52.20868084546647, 54.47897034376916, 56.7481819279467, 59.01154630778747, + 61.27085541729969, 63.528206668469586, 65.78341448045262, 68.03626556777253, 70.28651313565834, + 72.5338694707046, 74.78133526447758, 77.02911212097662, 79.27370995632032, 83.76435671372906, + 88.25435551349507, 92.74525760593423, 97.23920215681208, 101.73901182714235, 106.24099777689521, + 110.7472280150284, 122.03600942835084, + }; + + constexpr amrex::Real Fe53_pf_threshold_T9 = 0.6; + + // Fe54 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Fe54_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 9.299567576799903e-05, 0.0014169955873925225, 0.007321134970553677, 0.022123461487622495, + 0.04948135381425337, 0.09201931630258259, 0.1514756766228533, 0.22872236077796645, 0.43529377684509163, + 0.7011421355646771, 1.0099453601908912, 1.34893485484602, 1.7119979303561994, 2.509599262378372, + 3.391147045808654, 4.343805421853684, 5.342334251964811, 6.3561076606958915, 7.3777589082278725, + 8.405143687607614, 9.425451751593128, 10.451608961045816, 11.472103470449973, 14.0225247273486, + 16.556350581889475, 19.083368717027604, 21.59455920288983, 24.090561666932885, 26.569704612004134, + 29.037118104344618, 31.489643344629577, 33.928130435862485, 36.35685317245611, 38.7714325729303, + 41.176034426195145, 43.56999010098943, 45.954089031013915, 48.32999426030592, 50.696092759022285, + 53.05476731866737, 55.41046223697537, 57.75524768445979, 60.09832413880857, 62.432161775306724, + 64.7650522177961, 67.08977843666736, 69.41402502644259, 71.73781232708723, 74.05428653224195, + 76.36374450452375, 78.67993524957357, 80.98925437474897, 83.2985284558938, 87.91034318460056, + 92.52211405462002, 97.1272842406081, 101.73245442659619, 106.34418201313045, 110.94935219911854, + 115.56103706612782, 127.11218374391825, + }; + + constexpr amrex::Real Fe54_pf_threshold_T9 = 1.0; + + // Fe55 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Fe55_pf_array = { + 0.0, 0.0, 0.0, 0.0, 2.9999954999842446e-06, + 3.599935201547656e-05, 0.0001749846892862601, 0.0005458509962348388, 0.0012811789396579938, 0.002489897630568308, + 0.0042439815567507835, 0.021723330583716026, 0.052838150482648706, 0.09687441030310566, 0.15356793863801727, + 0.22207417974018792, 0.3010293499155029, 0.38896845006857994, 0.48462619650037303, 0.6957602634830437, + 0.9311072235406603, 1.1913051067738185, 1.4786223714009008, 1.794979612330987, 2.509599262378372, + 3.332204510175204, 4.216562194946349, 5.147494476813453, 6.100318952020064, 7.07326971745971, + 8.0519780789023, 9.041921720351219, 10.03889218954233, 11.03650126792157, 13.543701834668783, + 16.05728351156156, 18.56910074907064, 21.066855541336487, 23.562344300455024, 26.0364718159882, + 28.502314481871966, 30.95605713662514, 33.396212218713394, 35.82525042074837, 38.24254446151837, + 40.650243734413365, 43.04995151400136, 45.43921258233842, 47.82155649372092, 50.19642262942808, + 52.56493197079322, 54.92796711983561, 57.28491342204854, 59.63654060011019, 61.984672026712545, + 64.32851223341358, 66.6696071811695, 69.00713032552483, 71.3424360156314, 73.6756983608725, + 76.00511069609969, 78.33668332596699, 80.66743929592772, 82.99742336310989, 87.64665353889201, + 92.30225457850699, 96.95543398368144, 101.60641370570083, 106.26957114933927, 110.92954957182236, + 115.59298866593443, 127.28928335673105, + }; + + constexpr amrex::Real Fe55_pf_threshold_T9 = 0.3; + + // Fe56 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Fe56_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 3.999991999914312e-06, 2.2999735504161862e-05, 9.099585975123644e-05, + 0.00026996355655966415, 0.00711562379553272, 0.036122649876509136, 0.09416770925148646, 0.17582214798729476, + 0.2723587679931664, 0.37744210592173955, 0.4880608616770881, 0.6035325999923254, 0.8511487220072201, + 1.1254226572294825, 1.4290963940696066, 1.7632754575255085, 2.1292725925101696, 2.9601050959108397, + 3.9080149840306073, 4.9344739331306915, 6.0014148779611505, 7.07326971745971, 8.151909872940905, + 9.22029070282935, 10.288749953326773, 11.348050821779994, 12.404923504275338, 15.030423302328545, + 17.639794649084415, 20.235505486111418, 22.817595991119997, 25.38670493105848, 27.94583185576858, + 30.487491322149033, 33.02009284574505, 35.53572502980229, 38.04433379189708, 40.54019127287184, + 43.027570111805225, 45.503520449571155, 47.970093980042336, 50.4274588815412, 52.87824708343751, + 55.32031113998107, 57.75524768445979, 60.1892959170143, 62.614483332100676, 65.0319983917687, + 67.44791217006976, 69.85687766662237, 72.26390542298401, 74.66853977033223, 77.06711323915523, + 79.4665481581392, 81.86304385058315, 84.25660072178292, 86.6496014503734, 91.4320180309834, + 96.21099350873395, 100.98939803491464, 105.76809138799152, 110.54388709101038, 115.32810550844745, + 120.11286127141062, 132.10176562881668, + }; + + constexpr amrex::Real Fe56_pf_threshold_T9 = 0.6; + + // Co55 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Co55_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.9999980000601777e-06, 3.299945551192844e-05, 0.0002149768908123338, + 0.0008776147834635239, 0.0026504843609634825, 0.006510758935580232, 0.013783568660113304, 0.04542450669313041, + 0.11337689843044624, 0.2341190990271887, 0.4197354671252422, 0.6733637730790638, 1.3506671834767394, + 2.175887439948088, 3.068052935133617, 3.9982007016691985, 4.948759890378168, 5.910796644040527, + 6.887552571664617, 7.874739125171811, 8.869257522797287, 9.87302834505142, 12.392552212472792, + 14.927368073382404, 17.458346073576802, 19.980928412195695, 22.489707498190175, 24.983124837646084, + 27.463785196552635, 29.930601699902294, 32.384611307034916, 34.831446008873506, 37.26007182276292, + 39.68043995141335, 42.09363491595136, 44.49580471437484, 46.89326904555913, 49.27854585439829, + 51.66117365506587, 54.03786672021364, 56.40944468469464, 58.773587670688116, 61.13416002133251, + 63.491553350821555, 65.8460981827463, 68.19566348466455, 70.54312033183577, 72.89085982231036, + 75.23453177540692, 77.57658201060994, 79.91713370152783, 82.25818507534967, 86.9361146156202, + 91.61238072329202, 96.2900235580931, 100.96843290644959, 105.64972678791048, 110.33413387975575, + 115.02389413404445, 126.77320837707892, + }; + + constexpr amrex::Real Co55_pf_threshold_T9 = 1.5; + + // Co56 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Co56_pf_array = { + 0.0, 3.999991999914312e-06, 7.899687966427683e-05, 0.001695561722441503, 0.007822325681129151, + 0.019497678843342036, 0.03570492462077664, 0.05483944934120235, 0.07551926153050333, 0.09679362441063856, + 0.11809143254161966, 0.21920299752019912, 0.3136779817234165, 0.4068994123352315, 0.5003509554719695, + 0.5937841992390013, 0.6869223464179751, 0.7799081928776226, 0.8732608851743571, 1.0641747312980732, + 1.266494261306665, 1.4867261756605479, 1.7300104759595463, 1.9996490006286871, 2.617395832834079, + 3.342861804649192, 4.141546163706395, 4.997212273764115, 5.8944028342648505, 6.818924065275521, + 7.7664168980196555, 8.727454116899434, 9.70503661381229, 10.687389096364537, 13.178743710840436, + 15.691917501252615, 18.209959712636714, 20.72326583694641, 23.232865099324783, 25.72721214289187, + 28.207634480232542, 30.685022297606515, 33.14444986209353, 35.59656668905854, 38.041326270833125, + 40.473670590530276, 42.89814550113336, 45.31564717830969, 47.72692751285302, 50.13262340177087, + 52.530211502089486, 54.923768373289256, 57.3135985700474, 59.69879376622023, 62.07987280331125, + 64.45828367945377, 66.8332366049513, 69.20858105222777, 71.57898874156058, 73.95275011302252, + 76.32178030542472, 78.68666928175492, 81.05421227102374, 83.42369159884781, 88.15575353669053, + 92.89186108012609, 97.62885665889361, 102.37153438588587, 107.11887906065449, 111.87215761201388, + 116.62887769612918, 128.55615721662483, + }; + + constexpr amrex::Real Co56_pf_threshold_T9 = 0.01; + + // Co57 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Co57_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 9.999994999180668e-07, 0.00011499338800700186, 0.0013730569257571538, 0.006397492336686245, 0.01850276323097546, + 0.040556359242328484, 0.07447461921618648, 0.12123041992629299, 0.18109079972309278, 0.33921347598909773, + 0.5457283740750117, 0.7973625908347873, 1.0912415245367162, 1.42418438160196, 2.188295946591918, + 3.054001181677967, 3.983413001514819, 4.948759890378168, 5.940171252720432, 6.946975992135418, + 7.958576903813898, 8.982184278838428, 10.01234195744821, 11.042921835724492, 13.636383892066839, + 16.240313283682568, 18.8327903947792, 21.421400559017396, 24.000410569938587, 26.56681025397777, + 29.119420699985593, 31.66349027443256, 34.19487664246068, 36.71579826492938, 39.23012427713983, + 41.7241634104911, 44.2191203961326, 46.704027045920604, 49.17846239584131, 51.65012381887929, + 54.11318872675224, 56.57037505150728, 59.02091405779107, 61.470632257953724, 63.91376631623094, + 66.35337320678927, 68.79120316260337, 71.22465297997502, 73.65740516782517, 76.08966808412775, + 78.51900488276094, 80.94113512640477, 83.36929752678202, 85.79448494186839, 90.642385812446, + 95.49455076557048, 100.3435250178383, 105.19736762264446, 110.05567955583216, 114.91729828777864, + 119.78321499985981, 131.97971819437382, + }; + + constexpr amrex::Real Co57_pf_threshold_T9 = 0.9; + + // Ni56 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ni56_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 9.999994999180668e-07, 1.7999838002017484e-05, 0.00014798904908051437, + 0.0006687763192560828, 0.0021007917908672197, 0.005180557708084945, 0.0108093677159202, 0.033929817942853414, + 0.08125919821801637, 0.16557206393583876, 0.30308828495767837, 0.5109446166860524, 1.172482137234565, + 2.102913897864978, 3.1654750481410856, 4.272490747605575, 5.389071729816501, 6.498282149476434, + 7.605890001053122, 8.712759974960212, 9.814656338829513, 10.918718232265187, 13.664687668229691, + 16.38812278817138, 19.09362521719479, 21.774087461778173, 24.427033903554097, 27.056545465086103, + 29.664418719106976, 32.25599392921282, 34.82395533714435, 37.3778548584193, 39.91867374845115, + 42.44348030878443, 44.95807711272384, 47.46268883359117, 49.955692693611795, 52.438581179243556, + 54.91248475568723, 57.37829774665965, 59.83778360715438, 62.29201514356348, 64.73474686830077, + 67.18043280493549, 69.61404616033595, 72.04282585589065, 74.47118033617373, 76.89759077928012, + 79.31751257897871, 81.73470105471176, 84.14867938526342, 86.56428786666086, 91.38391256386228, + 96.2010760720766, 101.01398943805196, 105.82570189600392, 110.6374131490212, 115.4513381488714, + 120.26505308675254, 132.31206103765302, + }; + + constexpr amrex::Real Ni56_pf_threshold_T9 = 1.5; + + // Ni57 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ni57_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 9.999994999180668e-07, 3.999991999914312e-06, 2.1999758003515767e-05, 7.499718764066433e-05, + 0.00020197960074708863, 0.004008953397104444, 0.0179813619557224, 0.04424365396121746, 0.08043463086160929, + 0.1230915869981206, 0.16956554369275392, 0.21850400524573224, 0.2697209834825601, 0.38242845698978256, + 0.5195988264319741, 0.6967342393651639, 0.9268784832940384, 1.2156480822456945, 1.9487632180377197, + 2.8213788864092133, 3.756538102587751, 4.727387818712341, 5.720311776607412, 6.732210706467206, + 7.757906208351747, 8.793308627496552, 9.84161214881804, 10.89488575689709, 13.550242080349394, + 16.213405830762646, 18.87175636331258, 21.516258352476072, 24.137708445358587, 26.741859051442646, + 29.326636724603702, 31.893700992969865, 34.44446571543944, 36.98112343027989, 39.50858969448669, + 42.01751122047856, 44.51458460902644, 47.00721330490835, 49.488909679066104, 51.959784798049846, + 54.42502468087745, 56.88340871515647, 59.33448195869115, 61.78118951979749, 64.22392124453478, + 66.6617989987217, 69.09735541711756, 71.52855788793369, 73.95275011302252, 76.37735015657952, + 78.80071678822621, 81.22175003163346, 83.64447943646957, 86.06274892846308, 90.90275870552857, + 95.7383548318502, 100.57350530364421, 105.41141644405279, 110.25358721601651, 115.09982583901147, + 119.94953621530732, 132.10601191969812, + }; + + constexpr amrex::Real Ni57_pf_threshold_T9 = 0.5; + + // Ni58 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Ni58_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 6.499788759151895e-05, 0.0010874085569544608, 0.005954238288214293, 0.018769741111677243, + 0.04333627107625303, 0.08256291389970516, 0.1384489068080837, 0.21212628348615897, 0.4130674701171434, + 0.6787038764017188, 0.9964869046943904, 1.355513968039992, 1.7493953139667429, 2.624668592163159, + 3.6082115510464816, 4.653960350157523, 5.736572297479192, 6.834108738813838, 7.937374696163295, + 9.038365107236372, 10.142504453006628, 11.247656987355347, 12.35017298950393, 15.107494239612924, + 17.85504688369138, 20.587446113803875, 23.303482666538738, 25.996265395510157, 28.671297827583693, + 31.327372584881186, 33.96784684707499, 36.59290012860623, 39.202215489022755, 41.804206118164636, + 44.38569359595842, 46.959960420057804, 49.52055789001688, 52.07514945284195, 54.61958816561267, + 57.15515419534544, 59.683289579684256, 62.209018223992516, 64.71924268176481, 67.2323925438662, + 69.73507279273817, 72.23455321097148, 74.73354460064122, 77.22657665787314, 79.71580919760827, + 82.20390818849523, 84.68981035852474, 87.17250339368442, 89.6546361165897, 94.6130029821402, + 99.5707747866794, 104.52861189520867, 109.48562609786583, 114.4420895408199, 119.40313912575647, + 124.36915382392002, 136.8003098855822, + }; + + constexpr amrex::Real Ni58_pf_threshold_T9 = 1.0; + + // Cu59 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Cu59_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 5.99998200002249e-06, 3.7999278018272636e-05, 0.00014598934303724457, 0.00040491800963663984, 0.0008995952428359939, + 0.0017105361984473075, 0.012428445906924757, 0.03638689398559588, 0.073626784973166, 0.12292623116658526, + 0.18321282616205353, 0.25408159613801906, 0.3357819984616533, 0.4289771867440828, 0.6529614419193162, + 0.930428717890741, 1.2607722370732148, 1.6382636305011102, 2.0542709023528873, 2.9601050959108397, + 3.9318256327243257, 4.9344739331306915, 5.961005339623274, 6.993932975223189, 8.039157390473237, + 9.090430075303626, 10.142504453006628, 11.202315887874743, 12.259613412458204, 14.920767389351052, + 17.579033555073977, 20.235505486111418, 22.88543877622371, 25.527286881679668, 28.15574964486353, + 30.7794744765002, 33.38992288980583, 35.99039022215122, 38.58182766274523, 41.16549414415971, + 43.739066431033365, 46.3063440782545, 48.86711057930362, 51.417677874902765, 53.96375874805992, + 56.50619682581586, 59.0416760492395, 61.57377704101001, 64.10131892244245, 66.62414480709275, + 69.14521143829519, 71.66531682504908, 74.17741921764556, 76.6933438618572, 79.20817591494125, + 81.71864934570125, 84.23069253692425, 86.74108102323788, 89.24917100848154, 94.26902295768272, + 99.28879073534225, 104.31446390680304, 109.33991428668443, 114.37210213916643, 119.410078778867, + 124.45292370698547, 137.09667508060747, + }; + + constexpr amrex::Real Cu59_pf_threshold_T9 = 0.4; + + // Zn60 + + // this is log(partition function) + + inline AMREX_GPU_DEVICE amrex::Array1D Zn60_pf_array = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.9999980000601777e-06, 1.1999928000476974e-05, + 4.299907552651673e-05, 0.0021107707552105327, 0.014655087692010784, 0.04650565189537119, 0.0995484583270208, + 0.1701865579572265, 0.2532334746219091, 0.3443326907187112, 0.4407942846867419, 0.647054549773612, + 0.8778621209250755, 1.1497805752425092, 1.4806165530248636, 1.881161777329219, 2.8735646395797834, + 4.032469158504013, 5.241747015059643, 6.459904454377535, 7.6638772587034705, 8.85366542803745, + 10.025705185260378, 11.188579408146856, 12.337100907936577, 13.481435445942783, 16.308716010566968, + 19.11382792451231, 21.895747974180978, 24.660956589123135, 27.411620550893172, 30.14871758853954, + 32.87804518808903, 35.593088424682215, 38.29531449749844, 40.987665789057544, 43.67007355954642, + 46.34437147384374, 49.00661213891465, 51.66117365506587, 54.30753028716274, 56.946587616778004, + 59.57953034539341, 62.209018223992516, 64.82303947544645, 67.44279706940299, 70.0521124298195, + 72.6582900853156, 75.26170168075885, 77.86171501209185, 80.45808906674586, 83.05006709659531, + 85.6467240601399, 88.23539759975046, 90.82326955447033, 93.411736539412, 98.58498084903826, + 103.75609112710721, 108.92953516377385, 114.09923515249979, 119.2755589508551, 124.45292370698547, + 129.6379123882265, 142.61871220130905, + }; + + constexpr amrex::Real Zn60_pf_threshold_T9 = 0.7; + + + // interpolation routine + + template + AMREX_GPU_DEVICE AMREX_INLINE + void interpolate_pf(const amrex::Real t9, int idx, + const T& temp_array, const T& pf_array, + amrex::Real& logpf, amrex::Real& dlogpf_dT9) { + + // if the index is -1, we are either outside of the bounds or + // we never computed it. try recomputing here + if (idx == -1) { + idx = interp_net::find_index(t9, temp_array); + } + + // if the index is still -1, then we are out-of-bounds, so + // just skip the interpolation + + if (idx != -1) { + + // we have idx such that: + // temp_array[idx] <= t9 < temp_array[idx+1] + AMREX_ASSERT(t9 >= temp_array(idx) && t9 < temp_array(idx+1)); + + // find the derivative: dlog(pf)/dT9 -- this is + // (log(pf_{i+1}) - log(pf_i)) / (T_{i+1} - T_i) + + dlogpf_dT9 = (pf_array(idx+1) - pf_array(idx)) / + (temp_array(idx+1) - temp_array(idx)); + + // find log(PF) + + logpf = pf_array(idx) + dlogpf_dT9 * (t9 - temp_array(idx)); + + } else { + + // T < the smallest T or >= the largest T in the partition function table + logpf = 0.0; + dlogpf_dT9 = 0.0; + + } + + } + + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + amrex::Array2D data; + int index_temp_array_1{-1}; + + AMREX_GPU_DEVICE AMREX_INLINE + pf_cache_t() { + // The entries will be default-initialized to -900, + // log(partition_function) should never be -900. + for (int i = 1; i <= NumSpecTotal; ++i) { + data(i, 1) = -900.0_rt; + data(i, 2) = -900.0_rt; + } + } + }; + +} + +// get the partition function for nucleus inuc. Here pf_cache +// should already contain the index into the temp / pf arrays + +AMREX_GPU_DEVICE AMREX_INLINE +void get_partition_function(const int inuc, + [[maybe_unused]] const amrex::Real T9, + const part_fun::pf_cache_t& pf_cache, + amrex::Real& logpf, amrex::Real& dlogpf_dT9) { + + logpf = 0.0_rt; + dlogpf_dT9 = 0.0_rt; + + // inuc is the 1-based index for the species + + switch (inuc) { + + case O16: + if (T9 > part_fun::O16_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::O16_pf_array, logpf, dlogpf_dT9); + } + break; + + case O17: + if (T9 > part_fun::O17_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::O17_pf_array, logpf, dlogpf_dT9); + } + break; + + case O18: + if (T9 > part_fun::O18_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::O18_pf_array, logpf, dlogpf_dT9); + } + break; + + case F18: + if (T9 > part_fun::F18_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::F18_pf_array, logpf, dlogpf_dT9); + } + break; + + case F19: + if (T9 > part_fun::F19_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::F19_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ne20: + if (T9 > part_fun::Ne20_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ne20_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ne21: + if (T9 > part_fun::Ne21_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ne21_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ne22: + if (T9 > part_fun::Ne22_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ne22_pf_array, logpf, dlogpf_dT9); + } + break; + + case Na22: + if (T9 > part_fun::Na22_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Na22_pf_array, logpf, dlogpf_dT9); + } + break; + + case Na23: + if (T9 > part_fun::Na23_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Na23_pf_array, logpf, dlogpf_dT9); + } + break; + + case Mg24: + if (T9 > part_fun::Mg24_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Mg24_pf_array, logpf, dlogpf_dT9); + } + break; + + case Mg25: + if (T9 > part_fun::Mg25_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Mg25_pf_array, logpf, dlogpf_dT9); + } + break; + + case Al26: + if (T9 > part_fun::Al26_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Al26_pf_array, logpf, dlogpf_dT9); + } + break; + + case Al27: + if (T9 > part_fun::Al27_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Al27_pf_array, logpf, dlogpf_dT9); + } + break; + + case Si28: + if (T9 > part_fun::Si28_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Si28_pf_array, logpf, dlogpf_dT9); + } + break; + + case Si29: + if (T9 > part_fun::Si29_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Si29_pf_array, logpf, dlogpf_dT9); + } + break; + + case P30: + if (T9 > part_fun::P30_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::P30_pf_array, logpf, dlogpf_dT9); + } + break; + + case P31: + if (T9 > part_fun::P31_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::P31_pf_array, logpf, dlogpf_dT9); + } + break; + + case S32: + if (T9 > part_fun::S32_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::S32_pf_array, logpf, dlogpf_dT9); + } + break; + + case S33: + if (T9 > part_fun::S33_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::S33_pf_array, logpf, dlogpf_dT9); + } + break; + + case Cl34: + if (T9 > part_fun::Cl34_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Cl34_pf_array, logpf, dlogpf_dT9); + } + break; + + case Cl35: + if (T9 > part_fun::Cl35_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Cl35_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ar36: + if (T9 > part_fun::Ar36_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ar36_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ar37: + if (T9 > part_fun::Ar37_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ar37_pf_array, logpf, dlogpf_dT9); + } + break; + + case K38: + if (T9 > part_fun::K38_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::K38_pf_array, logpf, dlogpf_dT9); + } + break; + + case K39: + if (T9 > part_fun::K39_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::K39_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ca40: + if (T9 > part_fun::Ca40_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ca40_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ca41: + if (T9 > part_fun::Ca41_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ca41_pf_array, logpf, dlogpf_dT9); + } + break; + + case Sc42: + if (T9 > part_fun::Sc42_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Sc42_pf_array, logpf, dlogpf_dT9); + } + break; + + case Sc43: + if (T9 > part_fun::Sc43_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Sc43_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ti44: + if (T9 > part_fun::Ti44_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ti44_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ti45: + if (T9 > part_fun::Ti45_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ti45_pf_array, logpf, dlogpf_dT9); + } + break; + + case V46: + if (T9 > part_fun::V46_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::V46_pf_array, logpf, dlogpf_dT9); + } + break; + + case V47: + if (T9 > part_fun::V47_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::V47_pf_array, logpf, dlogpf_dT9); + } + break; + + case Cr48: + if (T9 > part_fun::Cr48_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Cr48_pf_array, logpf, dlogpf_dT9); + } + break; + + case Cr49: + if (T9 > part_fun::Cr49_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Cr49_pf_array, logpf, dlogpf_dT9); + } + break; + + case Mn50: + if (T9 > part_fun::Mn50_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Mn50_pf_array, logpf, dlogpf_dT9); + } + break; + + case Mn51: + if (T9 > part_fun::Mn51_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Mn51_pf_array, logpf, dlogpf_dT9); + } + break; + + case Mn52: + if (T9 > part_fun::Mn52_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Mn52_pf_array, logpf, dlogpf_dT9); + } + break; + + case Fe52: + if (T9 > part_fun::Fe52_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Fe52_pf_array, logpf, dlogpf_dT9); + } + break; + + case Fe53: + if (T9 > part_fun::Fe53_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Fe53_pf_array, logpf, dlogpf_dT9); + } + break; + + case Fe54: + if (T9 > part_fun::Fe54_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Fe54_pf_array, logpf, dlogpf_dT9); + } + break; + + case Fe55: + if (T9 > part_fun::Fe55_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Fe55_pf_array, logpf, dlogpf_dT9); + } + break; + + case Fe56: + if (T9 > part_fun::Fe56_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Fe56_pf_array, logpf, dlogpf_dT9); + } + break; + + case Co55: + if (T9 > part_fun::Co55_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Co55_pf_array, logpf, dlogpf_dT9); + } + break; + + case Co56: + if (T9 > part_fun::Co56_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Co56_pf_array, logpf, dlogpf_dT9); + } + break; + + case Co57: + if (T9 > part_fun::Co57_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Co57_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ni56: + if (T9 > part_fun::Ni56_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ni56_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ni57: + if (T9 > part_fun::Ni57_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ni57_pf_array, logpf, dlogpf_dT9); + } + break; + + case Ni58: + if (T9 > part_fun::Ni58_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Ni58_pf_array, logpf, dlogpf_dT9); + } + break; + + case Cu59: + if (T9 > part_fun::Cu59_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Cu59_pf_array, logpf, dlogpf_dT9); + } + break; + + case Zn60: + if (T9 > part_fun::Zn60_pf_threshold_T9) { + part_fun::interpolate_pf(T9, pf_cache.index_temp_array_1, part_fun::temp_array_1, part_fun::Zn60_pf_array, logpf, dlogpf_dT9); + } + break; + + + default: + + logpf = 0.0_rt; + dlogpf_dT9 = 0.0_rt; + + } + +} + + +// a version of get_partition_function where we have not cached the +// index into the arrays. Uses tfactors instead of T9 as argument, +// and returns pf and dpf_dT instead of logpf and dlogpf_dT9 + +AMREX_GPU_DEVICE AMREX_INLINE +void get_partition_function(const int inuc, + [[maybe_unused]] const tf_t& tfactors, + amrex::Real& pf, amrex::Real& dpf_dT) { + + // create a dummy cache. This will initialize the indices + // to -1 and we will force a search for the correct index + // when we do the interpolation. + + part_fun::pf_cache_t pf_cache; + + amrex::Real logpf, dlogpf_dT9; + get_partition_function(inuc, tfactors.T9, pf_cache, logpf, dlogpf_dT9); + + // Convert logpf to pf and dlogpf_dT9 to dpf_dT + pf = std::exp(logpf); + dpf_dT = pf * dlogpf_dT9 * 1.e-9_rt; +} + + +AMREX_GPU_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const amrex::Real T9, + part_fun::pf_cache_t& pf_cache, + amrex::Real& logpf, amrex::Real& dlogpf_dT9) { + if (pf_cache.data(inuc, 1) != -900.0_rt) { + // present in cache + amrex::ignore_unused(T9); + logpf = pf_cache.data(inuc, 1); + dlogpf_dT9 = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, T9, pf_cache, logpf, dlogpf_dT9); + pf_cache.data(inuc, 1) = logpf; + pf_cache.data(inuc, 2) = dlogpf_dT9; + } +} + + +template +AMREX_GPU_DEVICE AMREX_INLINE +constexpr amrex::Real get_spin_state() { + + static_assert(spec >= 1 && spec <= NumSpec); + + // Set the spin states (2J + 1) of the element + + if constexpr ( + spec == He4 || spec == C12 || spec == C14 || + spec == O16 || spec == O18 || spec == Ne20 || + spec == Ne22 || spec == Mg24 || spec == Si28 || + spec == S32 || spec == Cl34 || spec == Ar36 || + spec == Ca40 || spec == Sc42 || spec == Ti44 || + spec == V46 || spec == Cr48 || spec == Mn50 || + spec == Fe52 || spec == Fe54 || spec == Fe56 || + spec == Ni56 || spec == Ni58 || spec == Zn60 + ) + { + return 1.0_rt; + } + else if constexpr ( + spec == N || spec == H1 || spec == C13 || + spec == N13 || spec == N15 || spec == F19 || + spec == Si29 || spec == P31 + ) + { + return 2.0_rt; + } + else if constexpr ( + spec == N14 || spec == F18 || spec == P30 + ) + { + return 3.0_rt; + } + else if constexpr ( + spec == Ne21 || spec == Na23 || spec == S33 || + spec == Cl35 || spec == Ar37 || spec == K39 || + spec == V47 || spec == Fe55 || spec == Ni57 || + spec == Cu59 + ) + { + return 4.0_rt; + } + else if constexpr ( + spec == O17 || spec == Mg25 || spec == Al27 || + spec == Cr49 || spec == Mn51 + ) + { + return 6.0_rt; + } + else if constexpr ( + spec == Na22 || spec == K38 + ) + { + return 7.0_rt; + } + else if constexpr ( + spec == Ca41 || spec == Sc43 || spec == Ti45 || + spec == Fe53 || spec == Co55 || spec == Co57 + ) + { + return 8.0_rt; + } + else if constexpr ( + spec == Co56 + ) + { + return 9.0_rt; + } + else if constexpr ( + spec == Al26 + ) + { + return 11.0_rt; + } + else if constexpr ( + spec == Mn52 + ) + { + return 13.0_rt; + } + + // Return -1 if we don't recognize the species. + return -1.0_rt; +} + + +// Legacy (non-templated) interface + +AMREX_GPU_DEVICE AMREX_INLINE +amrex::Real get_spin_state (int spec) { + + amrex::Real s = -1.0_rt; + + // Set the spin states (2J + 1) of the element + + amrex::constexpr_for<1, NumSpec+1>([&] (auto n) { + if (n == spec) { + s = get_spin_state(); + } + }); + + return s; +} + + +#endif diff --git a/networks/he-burn/ase-big/pynucastro-info.txt b/networks/he-burn/ase-big/pynucastro-info.txt new file mode 100644 index 000000000..edeefdf79 --- /dev/null +++ b/networks/he-burn/ase-big/pynucastro-info.txt @@ -0,0 +1 @@ +pynucastro version: 2.12.0-21-gf93c3c73e diff --git a/networks/he-burn/ase-big/pynucastro.net b/networks/he-burn/ase-big/pynucastro.net new file mode 100644 index 000000000..639c52ff1 --- /dev/null +++ b/networks/he-burn/ase-big/pynucastro.net @@ -0,0 +1,61 @@ +neutron n 1.0 0.0 +hydrogen-1 H1 1.0 1.0 +helium-4 He4 4.0 2.0 +carbon-12 C12 12.0 6.0 +carbon-13 C13 13.0 6.0 +carbon-14 C14 14.0 6.0 +nitrogen-13 N13 13.0 7.0 +nitrogen-14 N14 14.0 7.0 +nitrogen-15 N15 15.0 7.0 +oxygen-16 O16 16.0 8.0 +oxygen-17 O17 17.0 8.0 +oxygen-18 O18 18.0 8.0 +fluorine-18 F18 18.0 9.0 +fluorine-19 F19 19.0 9.0 +neon-20 Ne20 20.0 10.0 +neon-21 Ne21 21.0 10.0 +neon-22 Ne22 22.0 10.0 +sodium-22 Na22 22.0 11.0 +sodium-23 Na23 23.0 11.0 +magnesium-24 Mg24 24.0 12.0 +magnesium-25 Mg25 25.0 12.0 +aluminum-26 Al26 26.0 13.0 +aluminum-27 Al27 27.0 13.0 +silicon-28 Si28 28.0 14.0 +silicon-29 Si29 29.0 14.0 +phosphorus-30 P30 30.0 15.0 +phosphorus-31 P31 31.0 15.0 +sulfur-32 S32 32.0 16.0 +sulfur-33 S33 33.0 16.0 +chlorine-34 Cl34 34.0 17.0 +chlorine-35 Cl35 35.0 17.0 +argon-36 Ar36 36.0 18.0 +argon-37 Ar37 37.0 18.0 +potassium-38 K38 38.0 19.0 +potassium-39 K39 39.0 19.0 +calcium-40 Ca40 40.0 20.0 +calcium-41 Ca41 41.0 20.0 +scandium-42 Sc42 42.0 21.0 +scandium-43 Sc43 43.0 21.0 +titanium-44 Ti44 44.0 22.0 +titanium-45 Ti45 45.0 22.0 +vanadium-46 V46 46.0 23.0 +vanadium-47 V47 47.0 23.0 +chromium-48 Cr48 48.0 24.0 +chromium-49 Cr49 49.0 24.0 +manganese-50 Mn50 50.0 25.0 +manganese-51 Mn51 51.0 25.0 +manganese-52 Mn52 52.0 25.0 +iron-52 Fe52 52.0 26.0 +iron-53 Fe53 53.0 26.0 +iron-54 Fe54 54.0 26.0 +iron-55 Fe55 55.0 26.0 +iron-56 Fe56 56.0 26.0 +cobalt-55 Co55 55.0 27.0 +cobalt-56 Co56 56.0 27.0 +cobalt-57 Co57 57.0 27.0 +nickel-56 Ni56 56.0 28.0 +nickel-57 Ni57 57.0 28.0 +nickel-58 Ni58 58.0 28.0 +copper-59 Cu59 59.0 29.0 +zinc-60 Zn60 60.0 30.0 diff --git a/networks/he-burn/ase-big/rate_type.H b/networks/he-burn/ase-big/rate_type.H new file mode 100644 index 000000000..4819ade44 --- /dev/null +++ b/networks/he-burn/ase-big/rate_type.H @@ -0,0 +1,25 @@ +#ifndef NET_RATE_TYPE_H +#define NET_RATE_TYPE_H + +#include + +struct rate_t { + amrex::Array1D screened_rates; +#ifdef SCREENING + amrex::Array1D log_screen; +#endif + amrex::Real enuc_weak; +}; + +struct rate_derivs_t { + amrex::Array1D screened_rates; + amrex::Array1D dscreened_rates_dT; +#ifdef SCREENING + amrex::Array1D log_screen; + amrex::Array1D dlog_screen_dT; +#endif + amrex::Real enuc_weak; +}; + + +#endif \ No newline at end of file diff --git a/networks/he-burn/ase-big/reaclib_rates.H b/networks/he-burn/ase-big/reaclib_rates.H new file mode 100644 index 000000000..542bded1d --- /dev/null +++ b/networks/he-burn/ase-big/reaclib_rates.H @@ -0,0 +1,9287 @@ +#ifndef REACLIB_RATES_H +#define REACLIB_RATES_H + +#include +#include + +#include +#include +#include + +using namespace Rates; +using namespace Species; + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C14_to_N14_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C14 --> N14 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // wc12w + ln_set_rate = -26.2827; + amrex::ignore_unused(tfactors); + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.0; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_N13_to_C13_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // N13 --> C13 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // wc12w + ln_set_rate = -6.7601; + amrex::ignore_unused(tfactors); + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.0; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_C12_to_N13_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C12 + p --> N13 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ls09n + ln_set_rate = 17.1482 + -13.692 * tfactors.T913i + -0.230881 * tfactors.T913 + + 4.44362 * tfactors.T9 + -3.15898 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -13.692 * tfactors.T943i + (1.0/3.0) * -0.230881 * tfactors.T923i + + 4.44362 + (5.0/3.0) * -3.15898 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // ls09r + ln_set_rate = 17.5428 + -3.77849 * tfactors.T9i + -5.10735 * tfactors.T913i + -2.24111 * tfactors.T913 + + 0.148883 * tfactors.T9 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.77849 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.10735 * tfactors.T943i + (1.0/3.0) * -2.24111 * tfactors.T923i + + 0.148883 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_C12_to_O16_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C12 + He4 --> O16 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // nac2 + ln_set_rate = 254.634 + -1.84097 * tfactors.T9i + 103.411 * tfactors.T913i + -420.567 * tfactors.T913 + + 64.0874 * tfactors.T9 + -12.4624 * tfactors.T953 + 137.303 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.84097 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 103.411 * tfactors.T943i + (1.0/3.0) * -420.567 * tfactors.T923i + + 64.0874 + (5.0/3.0) * -12.4624 * tfactors.T923 + 137.303 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nac2 + ln_set_rate = 69.6526 + -1.39254 * tfactors.T9i + 58.9128 * tfactors.T913i + -148.273 * tfactors.T913 + + 9.08324 * tfactors.T9 + -0.541041 * tfactors.T953 + 70.3554 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.39254 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 58.9128 * tfactors.T943i + (1.0/3.0) * -148.273 * tfactors.T923i + + 9.08324 + (5.0/3.0) * -0.541041 * tfactors.T923 + 70.3554 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_C13_to_N14_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C13 + p --> N14 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // nacrn + ln_set_rate = 18.5155 + -13.72 * tfactors.T913i + -0.450018 * tfactors.T913 + + 3.70823 * tfactors.T9 + -1.70545 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -13.72 * tfactors.T943i + (1.0/3.0) * -0.450018 * tfactors.T923i + + 3.70823 + (5.0/3.0) * -1.70545 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrr + ln_set_rate = 13.9637 + -5.78147 * tfactors.T9i + -0.196703 * tfactors.T913 + + 0.142126 * tfactors.T9 + -0.0238912 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.78147 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.196703 * tfactors.T923i + + 0.142126 + (5.0/3.0) * -0.0238912 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrr + ln_set_rate = 15.1825 + -13.5543 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 13.5543 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_C14_to_N15_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C14 + p --> N15 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = 17.1024 + -1.52341 * tfactors.T9i + -10.658 * tfactors.T913i + 1.73644 * tfactors.T913 + + -0.350498 * tfactors.T9 + 0.0279902 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.52341 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -10.658 * tfactors.T943i + (1.0/3.0) * 1.73644 * tfactors.T923i + + -0.350498 + (5.0/3.0) * 0.0279902 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 20.119 + -13.9619 * tfactors.T913i + -4.34315 * tfactors.T913 + + 6.64922 * tfactors.T9 + -3.22592 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -13.9619 * tfactors.T943i + (1.0/3.0) * -4.34315 * tfactors.T923i + + 6.64922 + (5.0/3.0) * -3.22592 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_C14_to_O18_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C14 + He4 --> O18 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = 11.8309 + -10.3983 * tfactors.T9i + -3.83188 * tfactors.T913 + + 1.64358 * tfactors.T9 + -0.177785 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.3983 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.83188 * tfactors.T923i + + 1.64358 + (5.0/3.0) * -0.177785 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -23.805 + -2.06876 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.06876 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 18.4877 + -31.7222 * tfactors.T913i + 11.3923 * tfactors.T913 + + -9.92249 * tfactors.T9 + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -31.7222 * tfactors.T943i + (1.0/3.0) * 11.3923 * tfactors.T923i + + -9.92249 + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_N14_to_F18_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // N14 + He4 --> F18 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = 13.8995 + -10.9656 * tfactors.T9i + -5.6227 * tfactors.T913i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.9656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.6227 * tfactors.T943i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 0.196838 + -5.16034 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.16034 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 21.5339 + -36.2504 * tfactors.T913i + + -5.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.2504 * tfactors.T943i + + (5.0/3.0) * -5.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_N15_to_O16_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // N15 + p --> O16 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // li10r + ln_set_rate = 14.5444 + -10.2295 * tfactors.T9i + + 0.0459037 * tfactors.T9 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.2295 * tfactors.T9i * tfactors.T9i + + 0.0459037 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // li10r + ln_set_rate = 6.59056 + -2.92315 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.92315 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // li10n + ln_set_rate = 20.0176 + -15.24 * tfactors.T913i + 0.334926 * tfactors.T913 + + 4.59088 * tfactors.T9 + -4.78468 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -15.24 * tfactors.T943i + (1.0/3.0) * 0.334926 * tfactors.T923i + + 4.59088 + (5.0/3.0) * -4.78468 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_N15_to_F19_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // N15 + He4 --> F19 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -28.7989 + -4.19986 * tfactors.T9i + 35.4292 * tfactors.T913 + + -5.5767 * tfactors.T9 + 0.441293 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.19986 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 35.4292 * tfactors.T923i + + -5.5767 + (5.0/3.0) * 0.441293 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 3.5342 + -6.98462 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.98462 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -9.41892 + -4.17795 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.17795 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 25.3916 + -36.2324 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.2324 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_O16_to_Ne20_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O16 + He4 --> Ne20 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // co10r + ln_set_rate = 3.88571 + -10.3585 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.3585 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // co10n + ln_set_rate = 23.903 + -39.7262 * tfactors.T913i + -0.210799 * tfactors.T913 + + 0.442879 * tfactors.T9 + -0.0797753 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.7262 * tfactors.T943i + (1.0/3.0) * -0.210799 * tfactors.T923i + + 0.442879 + (5.0/3.0) * -0.0797753 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // co10r + ln_set_rate = 9.50848 + -12.7643 * tfactors.T9i + -3.65925 * tfactors.T913 + + 0.714224 * tfactors.T9 + -0.00107508 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.7643 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.65925 * tfactors.T923i + + 0.714224 + (5.0/3.0) * -0.00107508 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_O17_to_F18_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O17 + p --> F18 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = 9.39048 + -6.22828 * tfactors.T9i + 2.31435 * tfactors.T913 + + -0.302835 * tfactors.T9 + 0.020133 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.22828 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 2.31435 * tfactors.T923i + + -0.302835 + (5.0/3.0) * 0.020133 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -13.077 + -0.746296 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.746296 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 15.8929 + -16.4035 * tfactors.T913i + 4.31885 * tfactors.T913 + + -0.709921 * tfactors.T9 + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -16.4035 * tfactors.T943i + (1.0/3.0) * 4.31885 * tfactors.T923i + + -0.709921 + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_O17_to_Ne21_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O17 + He4 --> Ne21 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // be13r + ln_set_rate = -25.0898 + -5.50926 * tfactors.T9i + 123.363 * tfactors.T913i + -87.4351 * tfactors.T913 + + -3.40974e-06 * tfactors.T9 + -57.0469 * tfactors.T953 + 82.2218 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.50926 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 123.363 * tfactors.T943i + (1.0/3.0) * -87.4351 * tfactors.T923i + + -3.40974e-06 + (5.0/3.0) * -57.0469 * tfactors.T923 + 82.2218 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // be13r + ln_set_rate = -117.134 + -13.6759 * tfactors.T9i + 3.31162e-08 * tfactors.T913i + 130.258 * tfactors.T913 + + -7.92551e-05 * tfactors.T9 + -4.13772 * tfactors.T953 + -42.7753 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 13.6759 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 3.31162e-08 * tfactors.T943i + (1.0/3.0) * 130.258 * tfactors.T923i + + -7.92551e-05 + (5.0/3.0) * -4.13772 * tfactors.T923 + -42.7753 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // be13r + ln_set_rate = 2.14 + -5.99952 * tfactors.T9i + 2.87641 * tfactors.T913i + -3.54489 * tfactors.T913 + + -2.11222e-08 * tfactors.T9 + -3.90649e-09 * tfactors.T953 + 4.75778 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.99952 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 2.87641 * tfactors.T943i + (1.0/3.0) * -3.54489 * tfactors.T923i + + -2.11222e-08 + (5.0/3.0) * -3.90649e-09 * tfactors.T923 + 4.75778 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_O18_to_F19_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O18 + p --> F19 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10n + ln_set_rate = 19.917 + -16.7246 * tfactors.T913i + + -3.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -16.7246 * tfactors.T943i + + (5.0/3.0) * -3.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 7.26876 + -6.7253 * tfactors.T9i + 3.99059 * tfactors.T913 + + -0.593127 * tfactors.T9 + 0.0877534 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.7253 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 3.99059 * tfactors.T923i + + -0.593127 + (5.0/3.0) * 0.0877534 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 5.07648 + -1.65681 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.65681 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -35.0079 + -0.244743 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.244743 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_O18_to_Ne22_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O18 + He4 --> Ne22 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -31.9126 + -2.00306 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.00306 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -81.3036 + -0.676112 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.676112 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 14.9748 + -31.0468 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 31.0468 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 82.2053 + -1.58534 * tfactors.T9i + -44.3823 * tfactors.T913i + -46.6617 * tfactors.T913 + + 7.88059 * tfactors.T9 + -0.590829 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.58534 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -44.3823 * tfactors.T943i + (1.0/3.0) * -46.6617 * tfactors.T923i + + 7.88059 + (5.0/3.0) * -0.590829 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_F18_to_Na22_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // F18 + He4 --> Na22 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 35.3786 + -1.82957 * tfactors.T9i + 18.8956 * tfactors.T913i + -65.6134 * tfactors.T913 + + 1.71114 * tfactors.T9 + -0.0260999 * tfactors.T953 + 37.8396 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.82957 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 18.8956 * tfactors.T943i + (1.0/3.0) * -65.6134 * tfactors.T923i + + 1.71114 + (5.0/3.0) * -0.0260999 * tfactors.T923 + 37.8396 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_F19_to_Ne20_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // F19 + p --> Ne20 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // nacrr + ln_set_rate = -5.63093 + -7.74414 * tfactors.T9i + 31.6442 * tfactors.T913i + -58.6563 * tfactors.T913 + + 67.7365 * tfactors.T9 + -22.9721 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 7.74414 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 31.6442 * tfactors.T943i + (1.0/3.0) * -58.6563 * tfactors.T923i + + 67.7365 + (5.0/3.0) * -22.9721 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrr + ln_set_rate = 12.3816 + -1.71383 * tfactors.T9i + -11.3832 * tfactors.T913i + 5.47872 * tfactors.T913 + + -1.07203 * tfactors.T9 + 0.11196 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.71383 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -11.3832 * tfactors.T943i + (1.0/3.0) * 5.47872 * tfactors.T923i + + -1.07203 + (5.0/3.0) * 0.11196 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrn + ln_set_rate = 18.2807 + -18.116 * tfactors.T913i + -1.4622 * tfactors.T913 + + 6.95113 * tfactors.T9 + -2.90366 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -18.116 * tfactors.T943i + (1.0/3.0) * -1.4622 * tfactors.T923i + + 6.95113 + (5.0/3.0) * -2.90366 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_F19_to_Na23_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // F19 + He4 --> Na23 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 52.7856 + -2.11408 * tfactors.T9i + 39.7219 * tfactors.T913i + -100.401 * tfactors.T913 + + 3.15808 * tfactors.T9 + -0.0629822 * tfactors.T953 + 54.4823 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.11408 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 39.7219 * tfactors.T943i + (1.0/3.0) * -100.401 * tfactors.T923i + + 3.15808 + (5.0/3.0) * -0.0629822 * tfactors.T923 + 54.4823 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ne20_to_Mg24_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ne20 + He4 --> Mg24 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -8.79827 + -12.7809 * tfactors.T9i + 16.9229 * tfactors.T913 + + -2.57325 * tfactors.T9 + 0.208997 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.7809 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 16.9229 * tfactors.T923i + + -2.57325 + (5.0/3.0) * 0.208997 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 1.98307 + -9.22026 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 9.22026 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -38.7055 + -2.50605 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.50605 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 24.5058 + -46.2525 * tfactors.T913i + 5.58901 * tfactors.T913 + + 7.61843 * tfactors.T9 + -3.683 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -46.2525 * tfactors.T943i + (1.0/3.0) * 5.58901 * tfactors.T923i + + 7.61843 + (5.0/3.0) * -3.683 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ne21_to_Na22_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ne21 + p --> Na22 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10n + ln_set_rate = 19.0696 + -19.2096 * tfactors.T913i + + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -19.2096 * tfactors.T943i + + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -39.4862 + -4.21385 * tfactors.T9i + 21.1176 * tfactors.T913i + 34.0411 * tfactors.T913 + + -4.45593 * tfactors.T9 + 0.328613 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.21385 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.1176 * tfactors.T943i + (1.0/3.0) * 34.0411 * tfactors.T923i + + -4.45593 + (5.0/3.0) * 0.328613 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 1.75704 + -1.39957 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.39957 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -47.6554 + -0.19618 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.19618 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ne21_to_Mg25_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ne21 + He4 --> Mg25 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88r + ln_set_rate = 26.2429 + -22.049 * tfactors.T9i + -29.4583 * tfactors.T913 + + 14.6328 * tfactors.T9 + -3.47392 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.049 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -29.4583 * tfactors.T923i + + 14.6328 + (5.0/3.0) * -3.47392 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // cf88n + ln_set_rate = 36.6927 + -46.89 * tfactors.T913i + -0.72642 * tfactors.T913 + + -0.76406 * tfactors.T9 + 0.0797483 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -46.89 * tfactors.T943i + (1.0/3.0) * -0.72642 * tfactors.T923i + + -0.76406 + (5.0/3.0) * 0.0797483 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ne22_to_Na23_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ne22 + p --> Na23 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ke17r + ln_set_rate = -0.599331 + -1.72007 * tfactors.T9i + + -0.310765 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.72007 * tfactors.T9i * tfactors.T9i + + -0.310765 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // ke17r + ln_set_rate = -21.4345 + -0.410962 * tfactors.T9i + + -1.49019 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.410962 * tfactors.T9i * tfactors.T9i + + -1.49019 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // ke17r + ln_set_rate = -4.09035 + -0.799756 * tfactors.T9i + + 3.23558 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.799756 * tfactors.T9i * tfactors.T9i + + 3.23558 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // ke17r + ln_set_rate = 14.0373 + -8.72377 * tfactors.T9i + + -0.767467 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 8.72377 * tfactors.T9i * tfactors.T9i + + -0.767467 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // ke17r + ln_set_rate = 11.6408 + -4.59936 * tfactors.T9i + + 0.156226 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.59936 * tfactors.T9i * tfactors.T9i + + 0.156226 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // ke17r + ln_set_rate = -4.00597 + -2.6179 * tfactors.T9i + + -4.29964 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.6179 * tfactors.T9i * tfactors.T9i + + -4.29964 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Na22_to_Al26_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Na22 + He4 --> Al26 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.3797 + -50.0924 * tfactors.T913i + -0.390826 * tfactors.T913 + + -0.99531 * tfactors.T9 + 0.101354 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -50.0924 * tfactors.T943i + (1.0/3.0) * -0.390826 * tfactors.T923i + + -0.99531 + (5.0/3.0) * 0.101354 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Na23_to_Mg24_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Na23 + p --> Mg24 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = 9.0594 + -3.28029 * tfactors.T9i + -0.360588 * tfactors.T913 + + 1.4187 * tfactors.T9 + -0.184061 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.28029 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.360588 * tfactors.T923i + + 1.4187 + (5.0/3.0) * -0.184061 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -5.02585 + -1.61219 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.61219 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 18.9075 + -20.6428 * tfactors.T913i + 1.52954 * tfactors.T913 + + 2.7487 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -20.6428 * tfactors.T943i + (1.0/3.0) * 1.52954 * tfactors.T923i + + 2.7487 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Na23_to_Al27_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Na23 + He4 --> Al27 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 44.7724 + -50.2042 * tfactors.T913i + -1.64239 * tfactors.T913 + + -1.59995 * tfactors.T9 + 0.184933 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -50.2042 * tfactors.T943i + (1.0/3.0) * -1.64239 * tfactors.T923i + + -1.59995 + (5.0/3.0) * 0.184933 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mg24_to_Si28_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mg24 + He4 --> Si28 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // st08r + ln_set_rate = 8.03977 + -15.629 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 15.629 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // st08r + ln_set_rate = -50.5494 + -12.8332 * tfactors.T9i + 21.3721 * tfactors.T913i + 37.7649 * tfactors.T913 + + -4.10635 * tfactors.T9 + 0.249618 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.8332 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.3721 * tfactors.T943i + (1.0/3.0) * 37.7649 * tfactors.T923i + + -4.10635 + (5.0/3.0) * 0.249618 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Mg25_to_Al26_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mg25 + p --> Al26 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = 4.21826 + -0.71983 * tfactors.T9i + -88.9297 * tfactors.T913 + + 302.948 * tfactors.T9 + -346.461 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.71983 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -88.9297 * tfactors.T923i + + 302.948 + (5.0/3.0) * -346.461 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -37.1963 + -0.429366 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.429366 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 2.22778 + -3.22353 * tfactors.T9i + 8.46334 * tfactors.T913 + + -0.907024 * tfactors.T9 + 0.0642981 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.22353 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.46334 * tfactors.T923i + + -0.907024 + (5.0/3.0) * 0.0642981 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mg25_to_Si29_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mg25 + He4 --> Si29 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88n + ln_set_rate = 40.3715 + -53.41 * tfactors.T913i + -1.83266 * tfactors.T913 + + -0.573073 * tfactors.T9 + 0.0462678 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -53.41 * tfactors.T943i + (1.0/3.0) * -1.83266 * tfactors.T923i + + -0.573073 + (5.0/3.0) * 0.0462678 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Al26_to_P30_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Al26 + He4 --> P30 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 42.9778 + -56.4422 * tfactors.T913i + -2.44848 * tfactors.T913 + + -1.17578 * tfactors.T9 + 0.150757 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -56.4422 * tfactors.T943i + (1.0/3.0) * -2.44848 * tfactors.T923i + + -1.17578 + (5.0/3.0) * 0.150757 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Al27_to_Si28_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Al27 + p --> Si28 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -13.6664 + -1.90396 * tfactors.T9i + 23.8634 * tfactors.T913 + + -3.70135 * tfactors.T9 + 0.28964 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.90396 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 23.8634 * tfactors.T923i + + -3.70135 + (5.0/3.0) * 0.28964 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 86.0234 + -0.387313 * tfactors.T9i + -26.8327 * tfactors.T913i + -116.137 * tfactors.T913 + + 0.00950567 * tfactors.T9 + 0.00999755 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.387313 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.8327 * tfactors.T943i + (1.0/3.0) * -116.137 * tfactors.T923i + + 0.00950567 + (5.0/3.0) * 0.00999755 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 21.1065 + -23.2205 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -23.2205 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Al27_to_P31_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Al27 + He4 --> P31 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 47.2333 + -56.5351 * tfactors.T913i + -0.896208 * tfactors.T913 + + -1.72024 * tfactors.T9 + 0.185409 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -56.5351 * tfactors.T943i + (1.0/3.0) * -0.896208 * tfactors.T923i + + -1.72024 + (5.0/3.0) * 0.185409 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Si28_to_S32_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Si28 + He4 --> S32 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 47.9212 + -59.4896 * tfactors.T913i + 4.47205 * tfactors.T913 + + -4.78989 * tfactors.T9 + 0.557201 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -59.4896 * tfactors.T943i + (1.0/3.0) * 4.47205 * tfactors.T923i + + -4.78989 + (5.0/3.0) * 0.557201 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Si29_to_P30_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Si29 + p --> P30 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -1.24791 + -3.33929 * tfactors.T9i + 14.0921 * tfactors.T913 + + -3.92096 * tfactors.T9 + 0.447706 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.33929 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 14.0921 * tfactors.T923i + + -3.92096 + (5.0/3.0) * 0.447706 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -13.4701 + -1.25026 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.25026 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 16.5182 + -23.9101 * tfactors.T913i + 10.7796 * tfactors.T913 + + -3.04181 * tfactors.T9 + 0.274565 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -23.9101 * tfactors.T943i + (1.0/3.0) * 10.7796 * tfactors.T923i + + -3.04181 + (5.0/3.0) * 0.274565 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Si29_to_S33_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Si29 + He4 --> S33 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 49.5657 + -59.5755 * tfactors.T913i + 1.06274 * tfactors.T913 + + -3.07529 * tfactors.T9 + 0.372011 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -59.5755 * tfactors.T943i + (1.0/3.0) * 1.06274 * tfactors.T923i + + -3.07529 + (5.0/3.0) * 0.372011 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_P30_to_Cl34_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // P30 + He4 --> Cl34 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 45.3321 + -62.4643 * tfactors.T913i + -3.19028 * tfactors.T913 + + -0.832633 * tfactors.T9 + 0.0987525 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -62.4643 * tfactors.T943i + (1.0/3.0) * -3.19028 * tfactors.T923i + + -0.832633 + (5.0/3.0) * 0.0987525 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_P31_to_S32_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // P31 + p --> S32 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = 0.821556 + -3.77704 * tfactors.T9i + 8.09341 * tfactors.T913 + + -0.615971 * tfactors.T9 + 0.031159 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.77704 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.09341 * tfactors.T923i + + -0.615971 + (5.0/3.0) * 0.031159 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -2.66839 + -2.25958 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.25958 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 19.2596 + -25.3278 * tfactors.T913i + 6.4931 * tfactors.T913 + + -9.27513 * tfactors.T9 + -0.610439 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -25.3278 * tfactors.T943i + (1.0/3.0) * 6.4931 * tfactors.T923i + + -9.27513 + (5.0/3.0) * -0.610439 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_P31_to_Cl35_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // P31 + He4 --> Cl35 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 50.451 + -62.5433 * tfactors.T913i + -2.95026 * tfactors.T913 + + -0.89652 * tfactors.T9 + 0.0774126 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -62.5433 * tfactors.T943i + (1.0/3.0) * -2.95026 * tfactors.T923i + + -0.89652 + (5.0/3.0) * 0.0774126 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_S32_to_Ar36_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // S32 + He4 --> Ar36 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 48.901 + -65.3709 * tfactors.T913i + 5.68294 * tfactors.T913 + + -5.00388 * tfactors.T9 + 0.571407 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -65.3709 * tfactors.T943i + (1.0/3.0) * 5.68294 * tfactors.T923i + + -5.00388 + (5.0/3.0) * 0.571407 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_S33_to_Cl34_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // S33 + p --> Cl34 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.4908 + -26.777 * tfactors.T913i + -5.96882 * tfactors.T913 + + -1.0706 * tfactors.T9 + 0.19692 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -26.777 * tfactors.T943i + (1.0/3.0) * -5.96882 * tfactors.T923i + + -1.0706 + (5.0/3.0) * 0.19692 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_S33_to_Ar37_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // S33 + He4 --> Ar37 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 49.9315 + -65.4446 * tfactors.T913i + 3.59607 * tfactors.T913 + + -3.40501 * tfactors.T9 + 0.363961 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -65.4446 * tfactors.T943i + (1.0/3.0) * 3.59607 * tfactors.T923i + + -3.40501 + (5.0/3.0) * 0.363961 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Cl34_to_K38_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cl34 + He4 --> K38 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 47.9589 + -68.2165 * tfactors.T913i + -2.18792 * tfactors.T913 + + -1.25322 * tfactors.T9 + 0.140901 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -68.2165 * tfactors.T943i + (1.0/3.0) * -2.18792 * tfactors.T923i + + -1.25322 + (5.0/3.0) * 0.140901 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Cl35_to_Ar36_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cl35 + p --> Ar36 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -42.5249 + -0.564651 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.564651 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 35.6868 + -27.8971 * tfactors.T913i + -16.2304 * tfactors.T913 + + 35.255 * tfactors.T9 + -25.8411 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -27.8971 * tfactors.T943i + (1.0/3.0) * -16.2304 * tfactors.T923i + + 35.255 + (5.0/3.0) * -25.8411 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -7.84699 + -3.65092 * tfactors.T9i + 18.0179 * tfactors.T913 + + -2.86304 * tfactors.T9 + 0.250854 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.65092 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0179 * tfactors.T923i + + -2.86304 + (5.0/3.0) * 0.250854 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -9.03294 + -2.00996 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.00996 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Cl35_to_K39_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cl35 + He4 --> K39 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 52.718 + -68.2848 * tfactors.T913i + 0.0178545 * tfactors.T913 + + -2.06783 * tfactors.T9 + 0.199659 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -68.2848 * tfactors.T943i + (1.0/3.0) * 0.0178545 * tfactors.T923i + + -2.06783 + (5.0/3.0) * 0.199659 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ar36_to_Ca40_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ar36 + He4 --> Ca40 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 52.3486 + -71.0046 * tfactors.T913i + 4.0656 * tfactors.T913 + + -5.26509 * tfactors.T9 + 0.683546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -71.0046 * tfactors.T943i + (1.0/3.0) * 4.0656 * tfactors.T923i + + -5.26509 + (5.0/3.0) * 0.683546 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ar37_to_K38_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ar37 + p --> K38 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.7254 + -28.9954 * tfactors.T913i + -5.57966 * tfactors.T913 + + -1.27516 * tfactors.T9 + 0.217568 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -28.9954 * tfactors.T943i + (1.0/3.0) * -5.57966 * tfactors.T923i + + -1.27516 + (5.0/3.0) * 0.217568 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ar37_to_Ca41_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ar37 + He4 --> Ca41 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 52.7522 + -71.0688 * tfactors.T913i + 2.71847 * tfactors.T913 + + -3.17333 * tfactors.T9 + 0.335323 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -71.0688 * tfactors.T943i + (1.0/3.0) * 2.71847 * tfactors.T923i + + -3.17333 + (5.0/3.0) * 0.335323 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_K38_to_Sc42_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // K38 + He4 --> Sc42 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 53.2593 + -73.7407 * tfactors.T913i + -7.08848 * tfactors.T913 + + 0.322473 * tfactors.T9 + -0.0523557 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -73.7407 * tfactors.T943i + (1.0/3.0) * -7.08848 * tfactors.T923i + + 0.322473 + (5.0/3.0) * -0.0523557 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_K39_to_Ca40_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // K39 + p --> Ca40 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // lo18r + ln_set_rate = 2761.38 + -5.22234 * tfactors.T9i + 802.18 * tfactors.T913i + -4010.27 * tfactors.T913 + + 1136.19 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.22234 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 802.18 * tfactors.T943i + (1.0/3.0) * -4010.27 * tfactors.T923i + + 1136.19 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // lo18r + ln_set_rate = 588.099 + -12.5647 * tfactors.T9i + 641.844 * tfactors.T913i + -1248.49 * tfactors.T913 + + 564.926 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.5647 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 641.844 * tfactors.T943i + (1.0/3.0) * -1248.49 * tfactors.T923i + + 564.926 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // lo18r + ln_set_rate = 102.252 + -1.66508 * tfactors.T9i + 41.1723 * tfactors.T913i + -149.299 * tfactors.T913 + + 10.5229 * tfactors.T9 + -0.68208 * tfactors.T953 + 59.2367 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.66508 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 41.1723 * tfactors.T943i + (1.0/3.0) * -149.299 * tfactors.T923i + + 10.5229 + (5.0/3.0) * -0.68208 * tfactors.T923 + 59.2367 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_K39_to_Sc43_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // K39 + He4 --> Sc43 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 54.1202 + -73.8006 * tfactors.T913i + 1.87885 * tfactors.T913 + + -2.75862 * tfactors.T9 + 0.279678 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -73.8006 * tfactors.T943i + (1.0/3.0) * 1.87885 * tfactors.T923i + + -2.75862 + (5.0/3.0) * 0.279678 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ca40_to_Ti44_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ca40 + He4 --> Ti44 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // chw0 + ln_set_rate = 53.75 + -76.4273 * tfactors.T913i + 3.87451 * tfactors.T913 + + -3.61477 * tfactors.T9 + 0.367451 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -76.4273 * tfactors.T943i + (1.0/3.0) * 3.87451 * tfactors.T923i + + -3.61477 + (5.0/3.0) * 0.367451 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ca41_to_Sc42_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ca41 + p --> Sc42 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 39.315 + -31.1321 * tfactors.T913i + -6.33393 * tfactors.T913 + + -1.39316 * tfactors.T9 + 0.255024 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -31.1321 * tfactors.T943i + (1.0/3.0) * -6.33393 * tfactors.T923i + + -1.39316 + (5.0/3.0) * 0.255024 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ca41_to_Ti45_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ca41 + He4 --> Ti45 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 54.6305 + -76.4839 * tfactors.T913i + 3.03748 * tfactors.T913 + + -2.59814 * tfactors.T9 + 0.210582 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -76.4839 * tfactors.T943i + (1.0/3.0) * 3.03748 * tfactors.T923i + + -2.59814 + (5.0/3.0) * 0.210582 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Sc42_to_V46_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Sc42 + He4 --> V46 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 51.7727 + -79.0687 * tfactors.T913i + -4.25493 * tfactors.T913 + + 0.184703 * tfactors.T9 + -0.0785452 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -79.0687 * tfactors.T943i + (1.0/3.0) * -4.25493 * tfactors.T923i + + 0.184703 + (5.0/3.0) * -0.0785452 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Sc43_to_Ti44_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Sc43 + p --> Ti44 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.8432 + -32.1734 * tfactors.T913i + -1.77078 * tfactors.T913 + + -2.21706 * tfactors.T9 + 0.298499 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * -1.77078 * tfactors.T923i + + -2.21706 + (5.0/3.0) * 0.298499 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Sc43_to_V47_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Sc43 + He4 --> V47 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 59.0195 + -79.122 * tfactors.T913i + -7.07006 * tfactors.T913 + + 0.424183 * tfactors.T9 + -0.0665231 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -79.122 * tfactors.T943i + (1.0/3.0) * -7.07006 * tfactors.T923i + + 0.424183 + (5.0/3.0) * -0.0665231 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ti44_to_Cr48_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ti44 + He4 --> Cr48 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 64.7958 + -81.667 * tfactors.T913i + -10.6333 * tfactors.T913 + + -0.672613 * tfactors.T9 + 0.161209 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -81.667 * tfactors.T943i + (1.0/3.0) * -10.6333 * tfactors.T923i + + -0.672613 + (5.0/3.0) * 0.161209 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ti45_to_V46_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ti45 + p --> V46 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.4468 + -33.1981 * tfactors.T913i + -1.66837 * tfactors.T913 + + -2.50285 * tfactors.T9 + 0.349152 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -33.1981 * tfactors.T943i + (1.0/3.0) * -1.66837 * tfactors.T923i + + -2.50285 + (5.0/3.0) * 0.349152 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ti45_to_Cr49_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ti45 + He4 --> Cr49 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 64.023 + -81.7175 * tfactors.T913i + -10.1755 * tfactors.T913 + + 0.364167 * tfactors.T9 + -0.000317666 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -81.7175 * tfactors.T943i + (1.0/3.0) * -10.1755 * tfactors.T923i + + 0.364167 + (5.0/3.0) * -0.000317666 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_V46_to_Mn50_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // V46 + He4 --> Mn50 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 54.311 + -84.2255 * tfactors.T913i + -4.85634 * tfactors.T913 + + 0.0528515 * tfactors.T9 + -0.0425496 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.2255 * tfactors.T943i + (1.0/3.0) * -4.85634 * tfactors.T923i + + 0.0528515 + (5.0/3.0) * -0.0425496 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_V47_to_Cr48_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // V47 + p --> Cr48 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // nfisn + ln_set_rate = 42.6798 + -6.0593 * tfactors.T9i + -34.0548 * tfactors.T913i + -3.41973 * tfactors.T913 + + 1.16501 * tfactors.T9 + -0.105543 * tfactors.T953 + -7.70886 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.0593 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.0548 * tfactors.T943i + (1.0/3.0) * -3.41973 * tfactors.T923i + + 1.16501 + (5.0/3.0) * -0.105543 * tfactors.T923 + -7.70886 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nfisn + ln_set_rate = 511.463 + -5.29491 * tfactors.T9i + 317.171 * tfactors.T913i + -911.679 * tfactors.T913 + + 94.4245 * tfactors.T9 + -10.1973 * tfactors.T953 + 330.727 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.29491 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 317.171 * tfactors.T943i + (1.0/3.0) * -911.679 * tfactors.T923i + + 94.4245 + (5.0/3.0) * -10.1973 * tfactors.T923 + 330.727 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nfisn + ln_set_rate = 23.8315 + 0.246665 * tfactors.T9i + -45.9868 * tfactors.T913i + 13.6822 * tfactors.T913 + + -0.376902 * tfactors.T9 + -0.0194875 * tfactors.T953 + -8.42325 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.246665 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -45.9868 * tfactors.T943i + (1.0/3.0) * 13.6822 * tfactors.T923i + + -0.376902 + (5.0/3.0) * -0.0194875 * tfactors.T923 + -8.42325 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nfisn + ln_set_rate = 40.5626 + -0.514414 * tfactors.T9i + -110.655 * tfactors.T913i + 83.0232 * tfactors.T913 + + -19.7762 * tfactors.T9 + 3.03961 * tfactors.T953 + -49.4742 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.514414 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -110.655 * tfactors.T943i + (1.0/3.0) * 83.0232 * tfactors.T923i + + -19.7762 + (5.0/3.0) * 3.03961 * tfactors.T923 + -49.4742 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_V47_to_Mn51_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // V47 + He4 --> Mn51 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 56.8618 + -84.2732 * tfactors.T913i + -2.98061 * tfactors.T913 + + -0.531361 * tfactors.T9 + 0.023612 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.2732 * tfactors.T943i + (1.0/3.0) * -2.98061 * tfactors.T923i + + -0.531361 + (5.0/3.0) * 0.023612 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Cr48_to_Fe52_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cr48 + He4 --> Fe52 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.1754 + -86.7459 * tfactors.T913i + -9.79373 * tfactors.T913 + + -0.772169 * tfactors.T9 + 0.155883 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * -9.79373 * tfactors.T923i + + -0.772169 + (5.0/3.0) * 0.155883 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Cr49_to_Mn50_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cr49 + p --> Mn50 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.3884 + -35.2018 * tfactors.T913i + 0.168579 * tfactors.T913 + + -2.87983 * tfactors.T9 + 0.378768 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -35.2018 * tfactors.T943i + (1.0/3.0) * 0.168579 * tfactors.T923i + + -2.87983 + (5.0/3.0) * 0.378768 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Mn51_to_Fe52_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn51 + p --> Fe52 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.2596 + -36.1825 * tfactors.T913i + 0.873042 * tfactors.T913 + + -2.89731 * tfactors.T9 + 0.364394 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.1825 * tfactors.T943i + (1.0/3.0) * 0.873042 * tfactors.T923i + + -2.89731 + (5.0/3.0) * 0.364394 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mn51_to_Co55_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn51 + He4 --> Co55 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.9219 + -89.274 * tfactors.T913i + -10.4373 * tfactors.T913 + + 1.00492 * tfactors.T9 + -0.125548 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -10.4373 * tfactors.T923i + + 1.00492 + (5.0/3.0) * -0.125548 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe52_to_Ni56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe52 + He4 --> Ni56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 66.6417 + -91.6819 * tfactors.T913i + -9.51885 * tfactors.T913 + + -0.533014 * tfactors.T9 + 0.0892607 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -9.51885 * tfactors.T923i + + -0.533014 + (5.0/3.0) * 0.0892607 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co55_to_Ni56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co55 + p --> Ni56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.3736 + -38.1053 * tfactors.T913i + -0.210947 * tfactors.T913 + + -2.68377 * tfactors.T9 + 0.355814 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1053 * tfactors.T943i + (1.0/3.0) * -0.210947 * tfactors.T923i + + -2.68377 + (5.0/3.0) * 0.355814 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C12_C12_to_p_Na23_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C12 + C12 --> p + Na23 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88r + ln_set_rate = 60.9649 + -84.165 * tfactors.T913i + -1.4191 * tfactors.T913 + + -0.114619 * tfactors.T9 + -0.070307 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.4191 * tfactors.T923i + + -0.114619 + (5.0/3.0) * -0.070307 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C12_C12_to_He4_Ne20_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // C12 + C12 --> He4 + Ne20 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88r + ln_set_rate = 61.2863 + -84.165 * tfactors.T913i + -1.56627 * tfactors.T913 + + -0.0736084 * tfactors.T9 + -0.072797 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.56627 * tfactors.T923i + + -0.0736084 + (5.0/3.0) * -0.072797 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_N13_to_p_O16_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // N13 + He4 --> p + O16 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88n + ln_set_rate = 40.4644 + -35.829 * tfactors.T913i + -0.530275 * tfactors.T913 + + -0.982462 * tfactors.T9 + 0.0808059 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -35.829 * tfactors.T943i + (1.0/3.0) * -0.530275 * tfactors.T923i + + -0.982462 + (5.0/3.0) * 0.0808059 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_N15_to_He4_C12_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // N15 + p --> He4 + C12 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // nacrn + ln_set_rate = 27.4764 + -15.253 * tfactors.T913i + 1.59318 * tfactors.T913 + + 2.4479 * tfactors.T9 + -2.19708 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -15.253 * tfactors.T943i + (1.0/3.0) * 1.59318 * tfactors.T923i + + 2.4479 + (5.0/3.0) * -2.19708 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrr + ln_set_rate = -6.57522 + -1.1638 * tfactors.T9i + 22.7105 * tfactors.T913 + + -2.90707 * tfactors.T9 + 0.205754 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.1638 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 22.7105 * tfactors.T923i + + -2.90707 + (5.0/3.0) * 0.205754 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrr + ln_set_rate = 20.8972 + -7.406 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 7.406 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrr + ln_set_rate = -4.87347 + -2.02117 * tfactors.T9i + 30.8497 * tfactors.T913 + + -8.50433 * tfactors.T9 + -1.54426 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.02117 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 30.8497 * tfactors.T923i + + -8.50433 + (5.0/3.0) * -1.54426 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C12_O16_to_p_Al27_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O16 + C12 --> p + Al27 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88r + ln_set_rate = 68.5253 + 0.205134 * tfactors.T9i + -119.242 * tfactors.T913i + 13.3667 * tfactors.T913 + + 0.295425 * tfactors.T9 + -0.267288 * tfactors.T953 + -9.91729 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.205134 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.242 * tfactors.T943i + (1.0/3.0) * 13.3667 * tfactors.T923i + + 0.295425 + (5.0/3.0) * -0.267288 * tfactors.T923 + -9.91729 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C12_O16_to_He4_Mg24_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O16 + C12 --> He4 + Mg24 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88r + ln_set_rate = 48.5341 + 0.37204 * tfactors.T9i + -133.413 * tfactors.T913i + 50.1572 * tfactors.T913 + + -3.15987 * tfactors.T9 + 0.0178251 * tfactors.T953 + -23.7027 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.37204 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -133.413 * tfactors.T943i + (1.0/3.0) * 50.1572 * tfactors.T923i + + -3.15987 + (5.0/3.0) * 0.0178251 * tfactors.T923 + -23.7027 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_O16_O16_to_p_P31_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O16 + O16 --> p + P31 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88r + ln_set_rate = 85.2628 + 0.223453 * tfactors.T9i + -145.844 * tfactors.T913i + 8.72612 * tfactors.T913 + + -0.554035 * tfactors.T9 + -0.137562 * tfactors.T953 + -6.88807 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.223453 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -145.844 * tfactors.T943i + (1.0/3.0) * 8.72612 * tfactors.T923i + + -0.554035 + (5.0/3.0) * -0.137562 * tfactors.T923 + -6.88807 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_O16_O16_to_He4_Si28_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O16 + O16 --> He4 + Si28 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // cf88r + ln_set_rate = 97.2435 + -0.268514 * tfactors.T9i + -119.324 * tfactors.T913i + -32.2497 * tfactors.T913 + + 1.46214 * tfactors.T9 + -0.200893 * tfactors.T953 + 13.2148 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.268514 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.324 * tfactors.T943i + (1.0/3.0) * -32.2497 * tfactors.T923i + + 1.46214 + (5.0/3.0) * -0.200893 * tfactors.T923 + 13.2148 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_O17_to_He4_N14_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O17 + p --> He4 + N14 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -7.20763 + -0.753395 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.753395 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 19.579 + -16.9078 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -16.9078 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 10.174 + -4.95865 * tfactors.T9i + 5.10182 * tfactors.T913 + + 0.379373 * tfactors.T9 + -0.0672515 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.95865 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.10182 * tfactors.T923i + + 0.379373 + (5.0/3.0) * -0.0672515 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 5.5336 + -2.11477 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.11477 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_O18_to_He4_N15_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // O18 + p --> He4 + N15 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -27.9044 + -0.245884 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.245884 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 26.9671 + -16.6979 * tfactors.T913i + + -3.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -16.6979 * tfactors.T943i + + (5.0/3.0) * -3.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 8.94352 + -5.32335 * tfactors.T9i + 11.6568 * tfactors.T913 + + -2.16303 * tfactors.T9 + 0.209965 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.32335 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 11.6568 * tfactors.T923i + + -2.16303 + (5.0/3.0) * 0.209965 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 10.2725 + -1.663 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.663 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_F18_to_p_Ne21_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // F18 + He4 --> p + Ne21 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 49.7863 + -1.84559 * tfactors.T9i + 21.4461 * tfactors.T913i + -73.252 * tfactors.T913 + + 2.42329 * tfactors.T9 + -0.077278 * tfactors.T953 + 40.7604 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.84559 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.4461 * tfactors.T943i + (1.0/3.0) * -73.252 * tfactors.T923i + + 2.42329 + (5.0/3.0) * -0.077278 * tfactors.T923 + 40.7604 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_F19_to_He4_O16_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // F19 + p --> He4 + O16 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // nacr + ln_set_rate = -52.7043 + -0.12765 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.12765 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacr + ln_set_rate = 26.2916 + -18.116 * tfactors.T913i + + 1.86674 * tfactors.T9 + -7.5666 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -18.116 * tfactors.T943i + + 1.86674 + (5.0/3.0) * -7.5666 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacrr + ln_set_rate = 14.3586 + -3.286 * tfactors.T9i + + -0.21103 * tfactors.T9 + 2.87702 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.286 * tfactors.T9i * tfactors.T9i + + -0.21103 + 2.87702 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacr + ln_set_rate = 15.1955 + -3.75185 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.75185 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // nacr + ln_set_rate = 8.239 + -2.46828 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.46828 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_F19_to_p_Ne22_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // F19 + He4 --> p + Ne22 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // da18r + ln_set_rate = 52.9317 + -2.8444 * tfactors.T9i + -38.7722 * tfactors.T913i + -13.3654 * tfactors.T913 + + 0.863648 * tfactors.T9 + -0.0451491 * tfactors.T953 + 1.33333 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.8444 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.7722 * tfactors.T943i + (1.0/3.0) * -13.3654 * tfactors.T923i + + 0.863648 + (5.0/3.0) * -0.0451491 * tfactors.T923 + 1.33333 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // da18r + ln_set_rate = 51.6709 + -45.7808 * tfactors.T9i + -34.5008 * tfactors.T913i + 56.9316 * tfactors.T913 + + 2.09613 * tfactors.T9 + -32.496 * tfactors.T953 + 0.333333 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 45.7808 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.5008 * tfactors.T943i + (1.0/3.0) * 56.9316 * tfactors.T923i + + 2.09613 + (5.0/3.0) * -32.496 * tfactors.T923 + 0.333333 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // da18r + ln_set_rate = 29430.6 + -133.026 * tfactors.T9i + 12625.1 * tfactors.T913i + -49107.1 * tfactors.T913 + + 9227.53 * tfactors.T9 + -2086.65 * tfactors.T953 + 14520.2 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 133.026 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 12625.1 * tfactors.T943i + (1.0/3.0) * -49107.1 * tfactors.T923i + + 9227.53 + (5.0/3.0) * -2086.65 * tfactors.T923 + 14520.2 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C12_Ne20_to_p_P31_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ne20 + C12 --> p + P31 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // rolfr + ln_set_rate = -268.136 + -38.7624 * tfactors.T9i + 361.154 * tfactors.T913i + -92.643 * tfactors.T913 + + -9.98738 * tfactors.T9 + 0.892737 * tfactors.T953 + 161.042 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 38.7624 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 361.154 * tfactors.T943i + (1.0/3.0) * -92.643 * tfactors.T923i + + -9.98738 + (5.0/3.0) * 0.892737 * tfactors.T923 + 161.042 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_C12_Ne20_to_He4_Si28_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ne20 + C12 --> He4 + Si28 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // rolfr + ln_set_rate = -308.905 + -47.2175 * tfactors.T9i + 514.197 * tfactors.T913i + -200.896 * tfactors.T913 + + -6.42713 * tfactors.T9 + 0.758256 * tfactors.T953 + 236.359 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 47.2175 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 514.197 * tfactors.T943i + (1.0/3.0) * -200.896 * tfactors.T923i + + -6.42713 + (5.0/3.0) * 0.758256 * tfactors.T923 + 236.359 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Na22_to_p_Mg25_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Na22 + He4 --> p + Mg25 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 44.973 + -50.0924 * tfactors.T913i + 0.807739 * tfactors.T913 + + -0.956029 * tfactors.T9 + 0.0793321 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -50.0924 * tfactors.T943i + (1.0/3.0) * 0.807739 * tfactors.T923i + + -0.956029 + (5.0/3.0) * 0.0793321 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Na23_to_He4_Ne20_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Na23 + p --> He4 + Ne20 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -6.58736 + -2.31577 * tfactors.T9i + 19.7297 * tfactors.T913 + + -2.20987 * tfactors.T9 + 0.153374 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.31577 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 19.7297 * tfactors.T923i + + -2.20987 + (5.0/3.0) * 0.153374 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 0.0178295 + -1.86103 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.86103 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 18.9756 + -20.0024 * tfactors.T913i + 11.5988 * tfactors.T913 + + -1.37398 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -20.0024 * tfactors.T943i + (1.0/3.0) * 11.5988 * tfactors.T923i + + -1.37398 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Al26_to_p_Si29_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Al26 + He4 --> p + Si29 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 47.7092 + -56.4422 * tfactors.T913i + 0.705353 * tfactors.T913 + + -0.957427 * tfactors.T9 + 0.0756045 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -56.4422 * tfactors.T943i + (1.0/3.0) * 0.705353 * tfactors.T923i + + -0.957427 + (5.0/3.0) * 0.0756045 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Al27_to_He4_Mg24_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Al27 + p --> He4 + Mg24 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -7.02789 + -4.2425 * tfactors.T9i + 18.0416 * tfactors.T913 + + -1.54137 * tfactors.T9 + 0.0847506 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.2425 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0416 * tfactors.T923i + + -1.54137 + (5.0/3.0) * 0.0847506 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -26.8683 + -0.963012 * tfactors.T9i + 5.18642 * tfactors.T913i + -34.7936 * tfactors.T913 + + 168.225 * tfactors.T9 + -115.825 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.963012 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 5.18642 * tfactors.T943i + (1.0/3.0) * -34.7936 * tfactors.T923i + + 168.225 + (5.0/3.0) * -115.825 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 29.4576 + -26.4162 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -26.4162 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_P30_to_p_S33_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // P30 + He4 --> p + S33 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 49.813 + -62.4643 * tfactors.T913i + 0.492934 * tfactors.T913 + + -0.841855 * tfactors.T9 + 0.059263 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -62.4643 * tfactors.T943i + (1.0/3.0) * 0.492934 * tfactors.T923i + + -0.841855 + (5.0/3.0) * 0.059263 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_P31_to_He4_Si28_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // P31 + p --> He4 + Si28 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -10.893 + -3.42575 * tfactors.T9i + 21.521 * tfactors.T913 + + -1.90355 * tfactors.T9 + 0.092724 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.42575 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 21.521 * tfactors.T923i + + -1.90355 + (5.0/3.0) * 0.092724 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -12.919 + -1.87716 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.87716 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 60.8829 + -31.932 * tfactors.T913i + -77.0334 * tfactors.T913 + + -43.6847 * tfactors.T9 + -4.28955 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -31.932 * tfactors.T943i + (1.0/3.0) * -77.0334 * tfactors.T923i + + -43.6847 + (5.0/3.0) * -4.28955 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Cl34_to_p_Ar37_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cl34 + He4 --> p + Ar37 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 52.795 + -68.2165 * tfactors.T913i + 0.330057 * tfactors.T913 + + -0.873334 * tfactors.T9 + 0.0592127 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -68.2165 * tfactors.T943i + (1.0/3.0) * 0.330057 * tfactors.T923i + + -0.873334 + (5.0/3.0) * 0.0592127 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Cl35_to_He4_S32_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cl35 + p --> He4 + S32 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // il10r + ln_set_rate = -1.01202 + -3.93495 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.93495 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = -57.5294 + -0.532931 * tfactors.T9i + 25.5338 * tfactors.T913 + + 6.45824 * tfactors.T9 + -0.950294 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.532931 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 25.5338 * tfactors.T923i + + 6.45824 + (5.0/3.0) * -0.950294 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10n + ln_set_rate = 32.12 + -30.9147 * tfactors.T913i + -1.2345 * tfactors.T913 + + 22.5118 * tfactors.T9 + -33.0589 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -30.9147 * tfactors.T943i + (1.0/3.0) * -1.2345 * tfactors.T923i + + 22.5118 + (5.0/3.0) * -33.0589 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // il10r + ln_set_rate = 2.29121 + -6.00976 * tfactors.T9i + 5.33756 * tfactors.T913 + + 1.64418 * tfactors.T9 + -0.246167 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.00976 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.33756 * tfactors.T923i + + 1.64418 + (5.0/3.0) * -0.246167 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_K38_to_p_Ca41_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // K38 + He4 --> p + Ca41 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 54.4204 + -73.7407 * tfactors.T913i + 0.600725 * tfactors.T913 + + -0.957475 * tfactors.T9 + 0.0689286 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -73.7407 * tfactors.T943i + (1.0/3.0) * 0.600725 * tfactors.T923i + + -0.957475 + (5.0/3.0) * 0.0689286 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_K39_to_He4_Ar36_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // K39 + p --> He4 + Ar36 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.5166 + -30.0732 * tfactors.T913i + 7.03263 * tfactors.T913 + + -1.10085 * tfactors.T9 + 0.133768 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -30.0732 * tfactors.T943i + (1.0/3.0) * 7.03263 * tfactors.T923i + + -1.10085 + (5.0/3.0) * 0.133768 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Sc42_to_p_Ti45_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Sc42 + He4 --> p + Ti45 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 57.6956 + -79.0687 * tfactors.T913i + -0.981235 * tfactors.T913 + + -0.48951 * tfactors.T9 + 0.0114272 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -79.0687 * tfactors.T943i + (1.0/3.0) * -0.981235 * tfactors.T923i + + -0.48951 + (5.0/3.0) * 0.0114272 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Sc43_to_He4_Ca40_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Sc43 + p --> He4 + Ca40 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 34.8559 + -32.1734 * tfactors.T913i + 0.0296879 * tfactors.T913 + + -0.95232 * tfactors.T9 + 0.129022 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * 0.0296879 * tfactors.T923i + + -0.95232 + (5.0/3.0) * 0.129022 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ti44_to_p_V47_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ti44 + He4 --> p + V47 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // chw0r + ln_set_rate = -76.5154 + -10.7931 * tfactors.T9i + 70.2835 * tfactors.T913 + + -7.99061 * tfactors.T9 + 0.486213 * tfactors.T953 + -1.5 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.7931 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 70.2835 * tfactors.T923i + + -7.99061 + (5.0/3.0) * 0.486213 * tfactors.T923 + -1.5 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_V46_to_p_Cr49_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // V46 + He4 --> p + Cr49 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 59.798 + -84.2255 * tfactors.T913i + -1.09776 * tfactors.T913 + + -0.495216 * tfactors.T9 + 0.0124719 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.2255 * tfactors.T943i + (1.0/3.0) * -1.09776 * tfactors.T923i + + -0.495216 + (5.0/3.0) * 0.0124719 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Cr48_to_p_Mn51_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cr48 + He4 --> p + Mn51 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 59.2276 + -86.7459 * tfactors.T913i + 1.05653 * tfactors.T913 + + -1.15757 * tfactors.T9 + 0.0877546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * 1.05653 * tfactors.T923i + + -1.15757 + (5.0/3.0) * 0.0877546 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Cr49_to_p_Mn52_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cr49 + He4 --> p + Mn52 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 52.5075 + -86.7913 * tfactors.T913i + 10.6892 * tfactors.T913 + + -4.01586 * tfactors.T9 + 0.411275 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -86.7913 * tfactors.T943i + (1.0/3.0) * 10.6892 * tfactors.T923i + + -4.01586 + (5.0/3.0) * 0.411275 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe52_to_p_Co55_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe52 + He4 --> p + Co55 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2207 + -91.6819 * tfactors.T913i + -0.329235 * tfactors.T913 + + -0.780924 * tfactors.T9 + 0.0425179 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -0.329235 * tfactors.T923i + + -0.780924 + (5.0/3.0) * 0.0425179 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_He4_He4_to_C12_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // 3 He4 --> C12 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // fy05r + ln_set_rate = -11.7884 + -1.02446 * tfactors.T9i + -23.57 * tfactors.T913i + 20.4886 * tfactors.T913 + + -12.9882 * tfactors.T9 + -20.0 * tfactors.T953 + -2.16667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.02446 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.57 * tfactors.T943i + (1.0/3.0) * 20.4886 * tfactors.T923i + + -12.9882 + (5.0/3.0) * -20.0 * tfactors.T923 + -2.16667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // fy05n + ln_set_rate = -0.971052 + -37.06 * tfactors.T913i + 29.3493 * tfactors.T913 + + -115.507 * tfactors.T9 + -10.0 * tfactors.T953 + -1.33333 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.06 * tfactors.T943i + (1.0/3.0) * 29.3493 * tfactors.T923i + + -115.507 + (5.0/3.0) * -10.0 * tfactors.T923 + -1.33333 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + + // fy05r + ln_set_rate = -24.3505 + -4.12656 * tfactors.T9i + -13.49 * tfactors.T913i + 21.4259 * tfactors.T913 + + -1.34769 * tfactors.T9 + 0.0879816 * tfactors.T953 + -13.1653 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.12656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.49 * tfactors.T943i + (1.0/3.0) * 21.4259 * tfactors.T923i + + -1.34769 + (5.0/3.0) * 0.0879816 * tfactors.T923 + -13.1653 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Mn50_to_Mn51_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn50 + n --> Mn51 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 15.4434 + -0.538879 * tfactors.T913 + + 0.284528 * tfactors.T9 + -0.0459849 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -0.538879 * tfactors.T923i + + 0.284528 + (5.0/3.0) * -0.0459849 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Mn51_to_Mn52_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn51 + n --> Mn52 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.2055 + -1.83611 * tfactors.T913 + + 0.460384 * tfactors.T9 + -0.0584947 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.83611 * tfactors.T923i + + 0.460384 + (5.0/3.0) * -0.0584947 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Mn52_to_Fe53_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn52 + p --> Fe53 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.4319 + -36.187 * tfactors.T913i + 1.79171 * tfactors.T913 + + -1.77786 * tfactors.T9 + 0.179936 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.187 * tfactors.T943i + (1.0/3.0) * 1.79171 * tfactors.T923i + + -1.77786 + (5.0/3.0) * 0.179936 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mn52_to_Co56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn52 + He4 --> Co56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 63.5657 + -89.3157 * tfactors.T913i + -1.95982 * tfactors.T913 + + -2.45671 * tfactors.T9 + 0.296095 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.3157 * tfactors.T943i + (1.0/3.0) * -1.95982 * tfactors.T923i + + -2.45671 + (5.0/3.0) * 0.296095 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Fe52_to_Fe53_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe52 + n --> Fe53 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 15.8885 + -0.344319 * tfactors.T913 + + 0.178277 * tfactors.T9 + -0.0334326 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -0.344319 * tfactors.T923i + + 0.178277 + (5.0/3.0) * -0.0334326 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Fe53_to_Fe54_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe53 + n --> Fe54 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 16.4534 + -1.10421 * tfactors.T913 + + 0.379905 * tfactors.T9 + -0.0581878 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.10421 * tfactors.T923i + + 0.379905 + (5.0/3.0) * -0.0581878 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe53_to_Ni57_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe53 + He4 --> Ni57 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 69.0636 + -91.7231 * tfactors.T913i + -10.1816 * tfactors.T913 + + -0.0406303 * tfactors.T9 + 0.0345056 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * -10.1816 * tfactors.T923i + + -0.0406303 + (5.0/3.0) * 0.0345056 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Fe54_to_Fe55_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe54 + n --> Fe55 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ks03 + ln_set_rate = -0.80864 + 0.0591716 * tfactors.T9i + -8.66617 * tfactors.T913i + 26.4472 * tfactors.T913 + + -1.9222 * tfactors.T9 + 0.0986404 * tfactors.T953 + -9.78317 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.0591716 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -8.66617 * tfactors.T943i + (1.0/3.0) * 26.4472 * tfactors.T923i + + -1.9222 + (5.0/3.0) * 0.0986404 * tfactors.T923 + -9.78317 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe54_to_Co55_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe54 + p --> Co55 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.2304 + -37.1544 * tfactors.T913i + 0.950364 * tfactors.T913 + + -1.77529 * tfactors.T9 + 0.198562 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1544 * tfactors.T943i + (1.0/3.0) * 0.950364 * tfactors.T923i + + -1.77529 + (5.0/3.0) * 0.198562 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe54_to_Ni58_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe54 + He4 --> Ni58 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.2478 + -91.7628 * tfactors.T913i + 4.23027 * tfactors.T913 + + -3.31305 * tfactors.T9 + 0.271293 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7628 * tfactors.T943i + (1.0/3.0) * 4.23027 * tfactors.T923i + + -3.31305 + (5.0/3.0) * 0.271293 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Fe55_to_Fe56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe55 + n --> Fe56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ks03 + ln_set_rate = 21.7202 + -0.0955677 * tfactors.T9i + 8.06062 * tfactors.T913i + -14.4809 * tfactors.T913 + + 0.94252 * tfactors.T9 + -0.0776007 * tfactors.T953 + 6.47093 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.0955677 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 8.06062 * tfactors.T943i + (1.0/3.0) * -14.4809 * tfactors.T923i + + 0.94252 + (5.0/3.0) * -0.0776007 * tfactors.T923 + 6.47093 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe55_to_Co56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe55 + p --> Co56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.7333 + -37.1585 * tfactors.T913i + 1.66198 * tfactors.T913 + + -1.60842 * tfactors.T9 + 0.148916 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1585 * tfactors.T943i + (1.0/3.0) * 1.66198 * tfactors.T923i + + -1.60842 + (5.0/3.0) * 0.148916 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Fe56_to_Co57_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe56 + p --> Co57 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.0665 + -37.1625 * tfactors.T913i + 1.06776 * tfactors.T913 + + -1.31689 * tfactors.T9 + 0.122089 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1625 * tfactors.T943i + (1.0/3.0) * 1.06776 * tfactors.T923i + + -1.31689 + (5.0/3.0) * 0.122089 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Co55_to_Co56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co55 + n --> Co56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.065 + -1.86357 * tfactors.T913 + + 0.616591 * tfactors.T9 + -0.0839313 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.86357 * tfactors.T923i + + 0.616591 + (5.0/3.0) * -0.0839313 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Co55_to_Cu59_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co55 + He4 --> Cu59 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.2921 + -94.1404 * tfactors.T913i + -2.62786 * tfactors.T913 + + -2.12066 * tfactors.T9 + 0.237999 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * -2.62786 * tfactors.T923i + + -2.12066 + (5.0/3.0) * 0.237999 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Co56_to_Co57_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co56 + n --> Co57 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.3552 + -1.37855 * tfactors.T913 + + 0.299896 * tfactors.T9 + -0.04382 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.37855 * tfactors.T923i + + 0.299896 + (5.0/3.0) * -0.04382 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co56_to_Ni57_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co56 + p --> Ni57 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.5937 + -38.1094 * tfactors.T913i + 2.57091 * tfactors.T913 + + -2.07795 * tfactors.T9 + 0.20757 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1094 * tfactors.T943i + (1.0/3.0) * 2.57091 * tfactors.T923i + + -2.07795 + (5.0/3.0) * 0.20757 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co57_to_Ni58_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co57 + p --> Ni58 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.0159 + -38.1133 * tfactors.T913i + 1.77414 * tfactors.T913 + + -1.48268 * tfactors.T9 + 0.121073 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 1.77414 * tfactors.T923i + + -1.48268 + (5.0/3.0) * 0.121073 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Ni56_to_Ni57_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni56 + n --> Ni57 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 16.0765 + -1.19665 * tfactors.T913 + + 0.507179 * tfactors.T9 + -0.074604 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.19665 * tfactors.T923i + + 0.507179 + (5.0/3.0) * -0.074604 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Ni56_to_Zn60_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni56 + He4 --> Zn60 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.0733 + -96.4898 * tfactors.T913i + 6.47209 * tfactors.T913 + + -5.2029 * tfactors.T9 + 0.533391 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -96.4898 * tfactors.T943i + (1.0/3.0) * 6.47209 * tfactors.T923i + + -5.2029 + (5.0/3.0) * 0.533391 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Ni57_to_Ni58_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni57 + n --> Ni58 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.2731 + -1.90814 * tfactors.T913 + + 0.493188 * tfactors.T9 + -0.0684633 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.90814 * tfactors.T923i + + 0.493188 + (5.0/3.0) * -0.0684633 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Ni58_to_Cu59_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni58 + p --> Cu59 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // si13n + ln_set_rate = 36.6662 + -39.0526 * tfactors.T913i + 1.0436 * tfactors.T913 + + -2.10834 * tfactors.T9 + 0.239559 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.0526 * tfactors.T943i + (1.0/3.0) * 1.0436 * tfactors.T923i + + -2.10834 + (5.0/3.0) * 0.239559 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Cu59_to_Zn60_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cu59 + p --> Zn60 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.226 + -39.9808 * tfactors.T913i + 1.17311 * tfactors.T913 + + -2.90486 * tfactors.T9 + 0.339644 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 1.17311 * tfactors.T923i + + -2.90486 + (5.0/3.0) * 0.339644 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mn50_to_p_Fe53_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn50 + He4 --> p + Fe53 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.6721 + -89.2309 * tfactors.T913i + -1.4758 * tfactors.T913 + + -0.437831 * tfactors.T9 + -0.00354594 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.2309 * tfactors.T943i + (1.0/3.0) * -1.4758 * tfactors.T923i + + -0.437831 + (5.0/3.0) * -0.00354594 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mn51_to_p_Fe54_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn51 + He4 --> p + Fe54 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2777 + -89.274 * tfactors.T913i + -0.862452 * tfactors.T913 + + -0.635672 * tfactors.T9 + 0.0196464 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -0.862452 * tfactors.T923i + + -0.635672 + (5.0/3.0) * 0.0196464 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Mn52_to_p_Fe55_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Mn52 + He4 --> p + Fe55 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 56.6689 + -89.3157 * tfactors.T913i + 5.65639 * tfactors.T913 + + -2.28952 * tfactors.T9 + 0.186017 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.3157 * tfactors.T943i + (1.0/3.0) * 5.65639 * tfactors.T923i + + -2.28952 + (5.0/3.0) * 0.186017 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Fe52_to_p_Mn52_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe52 + n --> p + Mn52 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.9485 + 0.569856 * tfactors.T913 + + 0.390117 * tfactors.T9 + -0.0479043 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 0.569856 * tfactors.T923i + + 0.390117 + (5.0/3.0) * -0.0479043 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Fe53_to_p_Co56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Fe53 + He4 --> p + Co56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 54.8614 + -91.7231 * tfactors.T913i + 10.052 * tfactors.T913 + + -3.86332 * tfactors.T9 + 0.391105 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * 10.052 * tfactors.T923i + + -3.86332 + (5.0/3.0) * 0.391105 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Co55_to_p_Fe55_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co55 + n --> p + Fe55 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.7398 + -1.62382 * tfactors.T913 + + 0.58115 * tfactors.T9 + -0.0537057 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.62382 * tfactors.T923i + + 0.58115 + (5.0/3.0) * -0.0537057 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Co55_to_He4_Mn52_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co55 + n --> He4 + Mn52 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = -12.5469 + 8.15876 * tfactors.T913 + + 3.05978 * tfactors.T9 + -0.406535 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 8.15876 * tfactors.T923i + + 3.05978 + (5.0/3.0) * -0.406535 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_He4_Co55_to_p_Ni58_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co55 + He4 --> p + Ni58 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.2281 + -94.1404 * tfactors.T913i + 3.39179 * tfactors.T913 + + -1.71062 * tfactors.T9 + 0.133003 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * 3.39179 * tfactors.T923i + + -1.71062 + (5.0/3.0) * 0.133003 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Co56_to_p_Fe56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co56 + n --> p + Fe56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.4539 + -1.13331 * tfactors.T913 + + 0.347185 * tfactors.T9 + -0.0328879 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.13331 * tfactors.T923i + + 0.347185 + (5.0/3.0) * -0.0328879 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Co57_to_He4_Fe54_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Co57 + p --> He4 + Fe54 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = -2.1962 + -38.1133 * tfactors.T913i + 29.3541 * tfactors.T913 + + -4.75966 * tfactors.T9 + 0.40418 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 29.3541 * tfactors.T923i + + -4.75966 + (5.0/3.0) * 0.40418 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Ni56_to_p_Co56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni56 + n --> p + Co56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 15.5693 + 1.76846 * tfactors.T913 + + 0.197992 * tfactors.T9 + -0.017494 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 1.76846 * tfactors.T923i + + 0.197992 + (5.0/3.0) * -0.017494 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Ni56_to_He4_Fe53_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni56 + n --> He4 + Fe53 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = -7.84393 + 6.43259 * tfactors.T913 + + 2.29591 * tfactors.T9 + -0.254724 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 6.43259 * tfactors.T923i + + 2.29591 + (5.0/3.0) * -0.254724 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Ni57_to_p_Co57_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni57 + n --> p + Co57 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 19.9939 + -1.13177 * tfactors.T913 + + 0.56875 * tfactors.T9 + -0.0579913 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.13177 * tfactors.T923i + + 0.56875 + (5.0/3.0) * -0.0579913 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Ni57_to_He4_Fe54_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni57 + n --> He4 + Fe54 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 14.5327 + 0.48562 * tfactors.T913 + + -0.0249302 * tfactors.T9 + 0.0509605 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 0.48562 * tfactors.T923i + + -0.0249302 + (5.0/3.0) * 0.0509605 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Ni58_to_He4_Fe55_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Ni58 + n --> He4 + Fe55 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = -2.03901 + 3.44996 * tfactors.T913 + + 2.98226 * tfactors.T9 + -0.387699 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 3.44996 * tfactors.T923i + + 2.98226 + (5.0/3.0) * -0.387699 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Cu59_to_He4_Co56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cu59 + n --> He4 + Co56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 11.0108 + -1.00882 * tfactors.T913 + + 1.88993 * tfactors.T9 + -0.202319 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.00882 * tfactors.T923i + + 1.88993 + (5.0/3.0) * -0.202319 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_p_Cu59_to_He4_Ni56_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Cu59 + p --> He4 + Ni56 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.7688 + -39.9808 * tfactors.T913i + 13.6773 * tfactors.T913 + + -3.76429 * tfactors.T9 + 0.438096 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 13.6773 * tfactors.T923i + + -3.76429 + (5.0/3.0) * 0.438096 * tfactors.T923 + -0.666667 * tfactors.T9i; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + +template +AMREX_GPU_DEVICE AMREX_INLINE +void rate_n_Zn60_to_He4_Ni57_reaclib(const tf_t& tfactors, const amrex::Real log_scor, const amrex::Real dlog_scor_dT, amrex::Real& rate, amrex::Real& drate_dT) { + + // Zn60 + n --> He4 + Ni57 + + rate = 0.0; + drate_dT = 0.0; + + amrex::Real ln_set_rate{0.0}; + amrex::Real dln_set_rate_dT9{0.0}; + amrex::Real set_rate{0.0}; + + // ths8r + ln_set_rate = 12.4241 + 5.43552 * tfactors.T913 + + -1.25169 * tfactors.T9 + 0.148383 * tfactors.T953; + + ln_set_rate += log_scor; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 5.43552 * tfactors.T923i + + -1.25169 + (5.0/3.0) * 0.148383 * tfactors.T923; + + dln_set_rate_dT9 += dlog_scor_dT * 1.0e9_rt; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 * 1.0e-9; + } + +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void +fill_reaclib_rates([[maybe_unused]] const tf_t& tfactors, + [[maybe_unused]] T& rate_eval) +{ + + [[maybe_unused]] amrex::Real rate; + [[maybe_unused]] amrex::Real drate_dT; + + { + // C14_to_N14_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_C14_to_N14_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C14_to_N14_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C14_to_N14_reaclib) = drate_dT; + } + } + + { + // N13_to_C13_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_N13_to_C13_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_N13_to_C13_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_N13_to_C13_reaclib) = drate_dT; + } + } + + { + // p_C12_to_N13_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_C12); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_C12); + } +#endif + rate_p_C12_to_N13_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_C12_to_N13_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_C12_to_N13_reaclib) = drate_dT; + } + } + + { + // He4_C12_to_O16_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_C12); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_C12); + } +#endif + rate_He4_C12_to_O16_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_C12_to_O16_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_C12_to_O16_reaclib) = drate_dT; + } + } + + { + // p_C13_to_N14_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_C13); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_C13); + } +#endif + rate_p_C13_to_N14_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_C13_to_N14_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_C13_to_N14_reaclib) = drate_dT; + } + } + + { + // p_C14_to_N15_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_C14); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_C14); + } +#endif + rate_p_C14_to_N15_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_C14_to_N15_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_C14_to_N15_reaclib) = drate_dT; + } + } + + { + // He4_C14_to_O18_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_C14); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_C14); + } +#endif + rate_He4_C14_to_O18_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_C14_to_O18_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_C14_to_O18_reaclib) = drate_dT; + } + } + + { + // He4_N14_to_F18_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_N14); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_N14); + } +#endif + rate_He4_N14_to_F18_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_N14_to_F18_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_N14_to_F18_reaclib) = drate_dT; + } + } + + { + // p_N15_to_O16_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_N15); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_N15); + } +#endif + rate_p_N15_to_O16_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_N15_to_O16_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_N15_to_O16_reaclib) = drate_dT; + } + } + + { + // He4_N15_to_F19_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_N15); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_N15); + } +#endif + rate_He4_N15_to_F19_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_N15_to_F19_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_N15_to_F19_reaclib) = drate_dT; + } + } + + { + // He4_O16_to_Ne20_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_O16); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_O16); + } +#endif + rate_He4_O16_to_Ne20_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_O16_to_Ne20_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_O16_to_Ne20_reaclib) = drate_dT; + } + } + + { + // p_O17_to_F18_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_O17); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_O17); + } +#endif + rate_p_O17_to_F18_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_O17_to_F18_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_O17_to_F18_reaclib) = drate_dT; + } + } + + { + // He4_O17_to_Ne21_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_O17); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_O17); + } +#endif + rate_He4_O17_to_Ne21_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_O17_to_Ne21_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_O17_to_Ne21_reaclib) = drate_dT; + } + } + + { + // p_O18_to_F19_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_O18); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_O18); + } +#endif + rate_p_O18_to_F19_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_O18_to_F19_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_O18_to_F19_reaclib) = drate_dT; + } + } + + { + // He4_O18_to_Ne22_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_O18); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_O18); + } +#endif + rate_He4_O18_to_Ne22_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_O18_to_Ne22_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_O18_to_Ne22_reaclib) = drate_dT; + } + } + + { + // He4_F18_to_Na22_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_F18); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_F18); + } +#endif + rate_He4_F18_to_Na22_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_F18_to_Na22_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_F18_to_Na22_reaclib) = drate_dT; + } + } + + { + // p_F19_to_Ne20_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_F19); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_F19); + } +#endif + rate_p_F19_to_Ne20_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_F19_to_Ne20_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_F19_to_Ne20_reaclib) = drate_dT; + } + } + + { + // He4_F19_to_Na23_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_F19); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_F19); + } +#endif + rate_He4_F19_to_Na23_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_F19_to_Na23_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_F19_to_Na23_reaclib) = drate_dT; + } + } + + { + // He4_Ne20_to_Mg24_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ne20); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ne20); + } +#endif + rate_He4_Ne20_to_Mg24_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ne20_to_Mg24_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ne20_to_Mg24_reaclib) = drate_dT; + } + } + + { + // p_Ne21_to_Na22_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ne21); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ne21); + } +#endif + rate_p_Ne21_to_Na22_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Ne21_to_Na22_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ne21_to_Na22_reaclib) = drate_dT; + } + } + + { + // He4_Ne21_to_Mg25_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ne21); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ne21); + } +#endif + rate_He4_Ne21_to_Mg25_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ne21_to_Mg25_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ne21_to_Mg25_reaclib) = drate_dT; + } + } + + { + // p_Ne22_to_Na23_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ne22); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ne22); + } +#endif + rate_p_Ne22_to_Na23_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Ne22_to_Na23_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ne22_to_Na23_reaclib) = drate_dT; + } + } + + { + // He4_Na22_to_Al26_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Na22); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Na22); + } +#endif + rate_He4_Na22_to_Al26_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Na22_to_Al26_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Na22_to_Al26_reaclib) = drate_dT; + } + } + + { + // p_Na23_to_Mg24_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Na23); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Na23); + } +#endif + rate_p_Na23_to_Mg24_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Na23_to_Mg24_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Na23_to_Mg24_reaclib) = drate_dT; + } + } + + { + // He4_Na23_to_Al27_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Na23); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Na23); + } +#endif + rate_He4_Na23_to_Al27_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Na23_to_Al27_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Na23_to_Al27_reaclib) = drate_dT; + } + } + + { + // He4_Mg24_to_Si28_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mg24); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mg24); + } +#endif + rate_He4_Mg24_to_Si28_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Mg24_to_Si28_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mg24_to_Si28_reaclib) = drate_dT; + } + } + + { + // p_Mg25_to_Al26_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Mg25); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Mg25); + } +#endif + rate_p_Mg25_to_Al26_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Mg25_to_Al26_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Mg25_to_Al26_reaclib) = drate_dT; + } + } + + { + // He4_Mg25_to_Si29_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mg25); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mg25); + } +#endif + rate_He4_Mg25_to_Si29_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Mg25_to_Si29_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mg25_to_Si29_reaclib) = drate_dT; + } + } + + { + // He4_Al26_to_P30_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Al26); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Al26); + } +#endif + rate_He4_Al26_to_P30_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Al26_to_P30_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Al26_to_P30_reaclib) = drate_dT; + } + } + + { + // p_Al27_to_Si28_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Al27); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Al27); + } +#endif + rate_p_Al27_to_Si28_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Al27_to_Si28_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Al27_to_Si28_reaclib) = drate_dT; + } + } + + { + // He4_Al27_to_P31_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Al27); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Al27); + } +#endif + rate_He4_Al27_to_P31_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Al27_to_P31_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Al27_to_P31_reaclib) = drate_dT; + } + } + + { + // He4_Si28_to_S32_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Si28); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Si28); + } +#endif + rate_He4_Si28_to_S32_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Si28_to_S32_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Si28_to_S32_reaclib) = drate_dT; + } + } + + { + // p_Si29_to_P30_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Si29); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Si29); + } +#endif + rate_p_Si29_to_P30_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Si29_to_P30_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Si29_to_P30_reaclib) = drate_dT; + } + } + + { + // He4_Si29_to_S33_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Si29); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Si29); + } +#endif + rate_He4_Si29_to_S33_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Si29_to_S33_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Si29_to_S33_reaclib) = drate_dT; + } + } + + { + // He4_P30_to_Cl34_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_P30); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_P30); + } +#endif + rate_He4_P30_to_Cl34_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_P30_to_Cl34_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_P30_to_Cl34_reaclib) = drate_dT; + } + } + + { + // p_P31_to_S32_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_P31); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_P31); + } +#endif + rate_p_P31_to_S32_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_P31_to_S32_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_P31_to_S32_reaclib) = drate_dT; + } + } + + { + // He4_P31_to_Cl35_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_P31); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_P31); + } +#endif + rate_He4_P31_to_Cl35_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_P31_to_Cl35_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_P31_to_Cl35_reaclib) = drate_dT; + } + } + + { + // He4_S32_to_Ar36_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_S32); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_S32); + } +#endif + rate_He4_S32_to_Ar36_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_S32_to_Ar36_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_S32_to_Ar36_reaclib) = drate_dT; + } + } + + { + // p_S33_to_Cl34_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_S33); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_S33); + } +#endif + rate_p_S33_to_Cl34_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_S33_to_Cl34_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_S33_to_Cl34_reaclib) = drate_dT; + } + } + + { + // He4_S33_to_Ar37_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_S33); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_S33); + } +#endif + rate_He4_S33_to_Ar37_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_S33_to_Ar37_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_S33_to_Ar37_reaclib) = drate_dT; + } + } + + { + // He4_Cl34_to_K38_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Cl34); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Cl34); + } +#endif + rate_He4_Cl34_to_K38_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Cl34_to_K38_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Cl34_to_K38_reaclib) = drate_dT; + } + } + + { + // p_Cl35_to_Ar36_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Cl35); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Cl35); + } +#endif + rate_p_Cl35_to_Ar36_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Cl35_to_Ar36_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Cl35_to_Ar36_reaclib) = drate_dT; + } + } + + { + // He4_Cl35_to_K39_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Cl35); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Cl35); + } +#endif + rate_He4_Cl35_to_K39_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Cl35_to_K39_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Cl35_to_K39_reaclib) = drate_dT; + } + } + + { + // He4_Ar36_to_Ca40_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ar36); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ar36); + } +#endif + rate_He4_Ar36_to_Ca40_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ar36_to_Ca40_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ar36_to_Ca40_reaclib) = drate_dT; + } + } + + { + // p_Ar37_to_K38_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ar37); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ar37); + } +#endif + rate_p_Ar37_to_K38_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Ar37_to_K38_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ar37_to_K38_reaclib) = drate_dT; + } + } + + { + // He4_Ar37_to_Ca41_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ar37); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ar37); + } +#endif + rate_He4_Ar37_to_Ca41_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ar37_to_Ca41_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ar37_to_Ca41_reaclib) = drate_dT; + } + } + + { + // He4_K38_to_Sc42_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_K38); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_K38); + } +#endif + rate_He4_K38_to_Sc42_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_K38_to_Sc42_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_K38_to_Sc42_reaclib) = drate_dT; + } + } + + { + // p_K39_to_Ca40_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_K39); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_K39); + } +#endif + rate_p_K39_to_Ca40_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_K39_to_Ca40_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_K39_to_Ca40_reaclib) = drate_dT; + } + } + + { + // He4_K39_to_Sc43_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_K39); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_K39); + } +#endif + rate_He4_K39_to_Sc43_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_K39_to_Sc43_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_K39_to_Sc43_reaclib) = drate_dT; + } + } + + { + // He4_Ca40_to_Ti44_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ca40); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ca40); + } +#endif + rate_He4_Ca40_to_Ti44_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ca40_to_Ti44_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ca40_to_Ti44_reaclib) = drate_dT; + } + } + + { + // p_Ca41_to_Sc42_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ca41); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ca41); + } +#endif + rate_p_Ca41_to_Sc42_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Ca41_to_Sc42_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ca41_to_Sc42_reaclib) = drate_dT; + } + } + + { + // He4_Ca41_to_Ti45_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ca41); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ca41); + } +#endif + rate_He4_Ca41_to_Ti45_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ca41_to_Ti45_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ca41_to_Ti45_reaclib) = drate_dT; + } + } + + { + // He4_Sc42_to_V46_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Sc42); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Sc42); + } +#endif + rate_He4_Sc42_to_V46_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Sc42_to_V46_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Sc42_to_V46_reaclib) = drate_dT; + } + } + + { + // p_Sc43_to_Ti44_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Sc43); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Sc43); + } +#endif + rate_p_Sc43_to_Ti44_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Sc43_to_Ti44_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Sc43_to_Ti44_reaclib) = drate_dT; + } + } + + { + // He4_Sc43_to_V47_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Sc43); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Sc43); + } +#endif + rate_He4_Sc43_to_V47_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Sc43_to_V47_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Sc43_to_V47_reaclib) = drate_dT; + } + } + + { + // He4_Ti44_to_Cr48_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ti44); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ti44); + } +#endif + rate_He4_Ti44_to_Cr48_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ti44_to_Cr48_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ti44_to_Cr48_reaclib) = drate_dT; + } + } + + { + // p_Ti45_to_V46_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ti45); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ti45); + } +#endif + rate_p_Ti45_to_V46_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Ti45_to_V46_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ti45_to_V46_reaclib) = drate_dT; + } + } + + { + // He4_Ti45_to_Cr49_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ti45); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ti45); + } +#endif + rate_He4_Ti45_to_Cr49_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ti45_to_Cr49_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ti45_to_Cr49_reaclib) = drate_dT; + } + } + + { + // He4_V46_to_Mn50_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_V46); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_V46); + } +#endif + rate_He4_V46_to_Mn50_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_V46_to_Mn50_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_V46_to_Mn50_reaclib) = drate_dT; + } + } + + { + // p_V47_to_Cr48_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_V47); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_V47); + } +#endif + rate_p_V47_to_Cr48_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_V47_to_Cr48_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_V47_to_Cr48_reaclib) = drate_dT; + } + } + + { + // He4_V47_to_Mn51_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_V47); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_V47); + } +#endif + rate_He4_V47_to_Mn51_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_V47_to_Mn51_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_V47_to_Mn51_reaclib) = drate_dT; + } + } + + { + // He4_Cr48_to_Fe52_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Cr48); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Cr48); + } +#endif + rate_He4_Cr48_to_Fe52_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Cr48_to_Fe52_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Cr48_to_Fe52_reaclib) = drate_dT; + } + } + + { + // p_Cr49_to_Mn50_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Cr49); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Cr49); + } +#endif + rate_p_Cr49_to_Mn50_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Cr49_to_Mn50_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Cr49_to_Mn50_reaclib) = drate_dT; + } + } + + { + // p_Mn51_to_Fe52_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Mn51); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Mn51); + } +#endif + rate_p_Mn51_to_Fe52_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Mn51_to_Fe52_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Mn51_to_Fe52_reaclib) = drate_dT; + } + } + + { + // He4_Mn51_to_Co55_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mn51); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mn51); + } +#endif + rate_He4_Mn51_to_Co55_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Mn51_to_Co55_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mn51_to_Co55_reaclib) = drate_dT; + } + } + + { + // He4_Fe52_to_Ni56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe52); + } +#endif + rate_He4_Fe52_to_Ni56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Fe52_to_Ni56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe52_to_Ni56_reaclib) = drate_dT; + } + } + + { + // p_Co55_to_Ni56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co55); + } +#endif + rate_p_Co55_to_Ni56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Co55_to_Ni56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co55_to_Ni56_reaclib) = drate_dT; + } + } + + { + // C12_C12_to_p_Na23_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_C12_C12); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_C12_C12); + } +#endif + rate_C12_C12_to_p_Na23_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C12_C12_to_p_Na23_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C12_C12_to_p_Na23_reaclib) = drate_dT; + } + } + + { + // C12_C12_to_He4_Ne20_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_C12_C12); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_C12_C12); + } +#endif + rate_C12_C12_to_He4_Ne20_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C12_C12_to_He4_Ne20_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C12_C12_to_He4_Ne20_reaclib) = drate_dT; + } + } + + { + // He4_N13_to_p_O16_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_N13); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_N13); + } +#endif + rate_He4_N13_to_p_O16_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_N13_to_p_O16_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_N13_to_p_O16_reaclib) = drate_dT; + } + } + + { + // p_N15_to_He4_C12_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_N15); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_N15); + } +#endif + rate_p_N15_to_He4_C12_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_N15_to_He4_C12_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_N15_to_He4_C12_reaclib) = drate_dT; + } + } + + { + // C12_O16_to_p_Al27_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_C12_O16); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_C12_O16); + } +#endif + rate_C12_O16_to_p_Al27_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C12_O16_to_p_Al27_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C12_O16_to_p_Al27_reaclib) = drate_dT; + } + } + + { + // C12_O16_to_He4_Mg24_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_C12_O16); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_C12_O16); + } +#endif + rate_C12_O16_to_He4_Mg24_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C12_O16_to_He4_Mg24_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C12_O16_to_He4_Mg24_reaclib) = drate_dT; + } + } + + { + // O16_O16_to_p_P31_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_O16_O16); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_O16_O16); + } +#endif + rate_O16_O16_to_p_P31_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_O16_O16_to_p_P31_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_O16_O16_to_p_P31_reaclib) = drate_dT; + } + } + + { + // O16_O16_to_He4_Si28_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_O16_O16); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_O16_O16); + } +#endif + rate_O16_O16_to_He4_Si28_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_O16_O16_to_He4_Si28_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_O16_O16_to_He4_Si28_reaclib) = drate_dT; + } + } + + { + // p_O17_to_He4_N14_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_O17); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_O17); + } +#endif + rate_p_O17_to_He4_N14_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_O17_to_He4_N14_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_O17_to_He4_N14_reaclib) = drate_dT; + } + } + + { + // p_O18_to_He4_N15_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_O18); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_O18); + } +#endif + rate_p_O18_to_He4_N15_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_O18_to_He4_N15_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_O18_to_He4_N15_reaclib) = drate_dT; + } + } + + { + // He4_F18_to_p_Ne21_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_F18); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_F18); + } +#endif + rate_He4_F18_to_p_Ne21_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_F18_to_p_Ne21_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_F18_to_p_Ne21_reaclib) = drate_dT; + } + } + + { + // p_F19_to_He4_O16_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_F19); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_F19); + } +#endif + rate_p_F19_to_He4_O16_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_F19_to_He4_O16_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_F19_to_He4_O16_reaclib) = drate_dT; + } + } + + { + // He4_F19_to_p_Ne22_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_F19); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_F19); + } +#endif + rate_He4_F19_to_p_Ne22_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_F19_to_p_Ne22_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_F19_to_p_Ne22_reaclib) = drate_dT; + } + } + + { + // C12_Ne20_to_p_P31_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_C12_Ne20); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_C12_Ne20); + } +#endif + rate_C12_Ne20_to_p_P31_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C12_Ne20_to_p_P31_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C12_Ne20_to_p_P31_reaclib) = drate_dT; + } + } + + { + // C12_Ne20_to_He4_Si28_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_C12_Ne20); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_C12_Ne20); + } +#endif + rate_C12_Ne20_to_He4_Si28_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_C12_Ne20_to_He4_Si28_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_C12_Ne20_to_He4_Si28_reaclib) = drate_dT; + } + } + + { + // He4_Na22_to_p_Mg25_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Na22); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Na22); + } +#endif + rate_He4_Na22_to_p_Mg25_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Na22_to_p_Mg25_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Na22_to_p_Mg25_reaclib) = drate_dT; + } + } + + { + // p_Na23_to_He4_Ne20_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Na23); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Na23); + } +#endif + rate_p_Na23_to_He4_Ne20_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Na23_to_He4_Ne20_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Na23_to_He4_Ne20_reaclib) = drate_dT; + } + } + + { + // He4_Al26_to_p_Si29_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Al26); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Al26); + } +#endif + rate_He4_Al26_to_p_Si29_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Al26_to_p_Si29_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Al26_to_p_Si29_reaclib) = drate_dT; + } + } + + { + // p_Al27_to_He4_Mg24_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Al27); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Al27); + } +#endif + rate_p_Al27_to_He4_Mg24_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Al27_to_He4_Mg24_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Al27_to_He4_Mg24_reaclib) = drate_dT; + } + } + + { + // He4_P30_to_p_S33_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_P30); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_P30); + } +#endif + rate_He4_P30_to_p_S33_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_P30_to_p_S33_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_P30_to_p_S33_reaclib) = drate_dT; + } + } + + { + // p_P31_to_He4_Si28_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_P31); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_P31); + } +#endif + rate_p_P31_to_He4_Si28_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_P31_to_He4_Si28_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_P31_to_He4_Si28_reaclib) = drate_dT; + } + } + + { + // He4_Cl34_to_p_Ar37_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Cl34); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Cl34); + } +#endif + rate_He4_Cl34_to_p_Ar37_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Cl34_to_p_Ar37_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Cl34_to_p_Ar37_reaclib) = drate_dT; + } + } + + { + // p_Cl35_to_He4_S32_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Cl35); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Cl35); + } +#endif + rate_p_Cl35_to_He4_S32_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Cl35_to_He4_S32_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Cl35_to_He4_S32_reaclib) = drate_dT; + } + } + + { + // He4_K38_to_p_Ca41_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_K38); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_K38); + } +#endif + rate_He4_K38_to_p_Ca41_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_K38_to_p_Ca41_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_K38_to_p_Ca41_reaclib) = drate_dT; + } + } + + { + // p_K39_to_He4_Ar36_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_K39); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_K39); + } +#endif + rate_p_K39_to_He4_Ar36_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_K39_to_He4_Ar36_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_K39_to_He4_Ar36_reaclib) = drate_dT; + } + } + + { + // He4_Sc42_to_p_Ti45_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Sc42); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Sc42); + } +#endif + rate_He4_Sc42_to_p_Ti45_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Sc42_to_p_Ti45_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Sc42_to_p_Ti45_reaclib) = drate_dT; + } + } + + { + // p_Sc43_to_He4_Ca40_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Sc43); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Sc43); + } +#endif + rate_p_Sc43_to_He4_Ca40_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Sc43_to_He4_Ca40_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Sc43_to_He4_Ca40_reaclib) = drate_dT; + } + } + + { + // He4_Ti44_to_p_V47_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ti44); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ti44); + } +#endif + rate_He4_Ti44_to_p_V47_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ti44_to_p_V47_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ti44_to_p_V47_reaclib) = drate_dT; + } + } + + { + // He4_V46_to_p_Cr49_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_V46); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_V46); + } +#endif + rate_He4_V46_to_p_Cr49_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_V46_to_p_Cr49_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_V46_to_p_Cr49_reaclib) = drate_dT; + } + } + + { + // He4_Cr48_to_p_Mn51_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Cr48); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Cr48); + } +#endif + rate_He4_Cr48_to_p_Mn51_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Cr48_to_p_Mn51_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Cr48_to_p_Mn51_reaclib) = drate_dT; + } + } + + { + // He4_Cr49_to_p_Mn52_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Cr49); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Cr49); + } +#endif + rate_He4_Cr49_to_p_Mn52_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Cr49_to_p_Mn52_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Cr49_to_p_Mn52_reaclib) = drate_dT; + } + } + + { + // He4_Fe52_to_p_Co55_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe52); + } +#endif + rate_He4_Fe52_to_p_Co55_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Fe52_to_p_Co55_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe52_to_p_Co55_reaclib) = drate_dT; + } + } + + { + // He4_He4_He4_to_C12_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_He4) + rate_eval.log_screen(k_He4_Be8); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_He4) + rate_eval.dlog_screen_dT(k_He4_Be8); + } +#endif + rate_He4_He4_He4_to_C12_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_He4_He4_to_C12_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_He4_He4_to_C12_reaclib) = drate_dT; + } + } + + { + // n_Mn50_to_Mn51_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Mn50_to_Mn51_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Mn50_to_Mn51_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Mn50_to_Mn51_reaclib) = drate_dT; + } + } + + { + // n_Mn51_to_Mn52_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Mn51_to_Mn52_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Mn51_to_Mn52_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Mn51_to_Mn52_reaclib) = drate_dT; + } + } + + { + // p_Mn52_to_Fe53_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Mn52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Mn52); + } +#endif + rate_p_Mn52_to_Fe53_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Mn52_to_Fe53_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Mn52_to_Fe53_reaclib) = drate_dT; + } + } + + { + // He4_Mn52_to_Co56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mn52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mn52); + } +#endif + rate_He4_Mn52_to_Co56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Mn52_to_Co56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mn52_to_Co56_reaclib) = drate_dT; + } + } + + { + // n_Fe52_to_Fe53_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Fe52_to_Fe53_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Fe52_to_Fe53_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Fe52_to_Fe53_reaclib) = drate_dT; + } + } + + { + // n_Fe53_to_Fe54_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Fe53_to_Fe54_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Fe53_to_Fe54_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Fe53_to_Fe54_reaclib) = drate_dT; + } + } + + { + // He4_Fe53_to_Ni57_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe53); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe53); + } +#endif + rate_He4_Fe53_to_Ni57_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Fe53_to_Ni57_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe53_to_Ni57_reaclib) = drate_dT; + } + } + + { + // n_Fe54_to_Fe55_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Fe54_to_Fe55_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Fe54_to_Fe55_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Fe54_to_Fe55_reaclib) = drate_dT; + } + } + + { + // p_Fe54_to_Co55_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe54); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe54); + } +#endif + rate_p_Fe54_to_Co55_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Fe54_to_Co55_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe54_to_Co55_reaclib) = drate_dT; + } + } + + { + // He4_Fe54_to_Ni58_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe54); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe54); + } +#endif + rate_He4_Fe54_to_Ni58_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Fe54_to_Ni58_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe54_to_Ni58_reaclib) = drate_dT; + } + } + + { + // n_Fe55_to_Fe56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Fe55_to_Fe56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Fe55_to_Fe56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Fe55_to_Fe56_reaclib) = drate_dT; + } + } + + { + // p_Fe55_to_Co56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe55); + } +#endif + rate_p_Fe55_to_Co56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Fe55_to_Co56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe55_to_Co56_reaclib) = drate_dT; + } + } + + { + // p_Fe56_to_Co57_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Fe56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Fe56); + } +#endif + rate_p_Fe56_to_Co57_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Fe56_to_Co57_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Fe56_to_Co57_reaclib) = drate_dT; + } + } + + { + // n_Co55_to_Co56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Co55_to_Co56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Co55_to_Co56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Co55_to_Co56_reaclib) = drate_dT; + } + } + + { + // He4_Co55_to_Cu59_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Co55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Co55); + } +#endif + rate_He4_Co55_to_Cu59_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Co55_to_Cu59_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Co55_to_Cu59_reaclib) = drate_dT; + } + } + + { + // n_Co56_to_Co57_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Co56_to_Co57_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Co56_to_Co57_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Co56_to_Co57_reaclib) = drate_dT; + } + } + + { + // p_Co56_to_Ni57_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co56); + } +#endif + rate_p_Co56_to_Ni57_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Co56_to_Ni57_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co56_to_Ni57_reaclib) = drate_dT; + } + } + + { + // p_Co57_to_Ni58_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co57); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co57); + } +#endif + rate_p_Co57_to_Ni58_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Co57_to_Ni58_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co57_to_Ni58_reaclib) = drate_dT; + } + } + + { + // n_Ni56_to_Ni57_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Ni56_to_Ni57_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Ni56_to_Ni57_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Ni56_to_Ni57_reaclib) = drate_dT; + } + } + + { + // He4_Ni56_to_Zn60_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Ni56); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Ni56); + } +#endif + rate_He4_Ni56_to_Zn60_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Ni56_to_Zn60_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Ni56_to_Zn60_reaclib) = drate_dT; + } + } + + { + // n_Ni57_to_Ni58_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Ni57_to_Ni58_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Ni57_to_Ni58_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Ni57_to_Ni58_reaclib) = drate_dT; + } + } + + { + // p_Ni58_to_Cu59_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Ni58); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Ni58); + } +#endif + rate_p_Ni58_to_Cu59_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Ni58_to_Cu59_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Ni58_to_Cu59_reaclib) = drate_dT; + } + } + + { + // p_Cu59_to_Zn60_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Cu59); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Cu59); + } +#endif + rate_p_Cu59_to_Zn60_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Cu59_to_Zn60_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Cu59_to_Zn60_reaclib) = drate_dT; + } + } + + { + // He4_Mn50_to_p_Fe53_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mn50); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mn50); + } +#endif + rate_He4_Mn50_to_p_Fe53_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Mn50_to_p_Fe53_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mn50_to_p_Fe53_reaclib) = drate_dT; + } + } + + { + // He4_Mn51_to_p_Fe54_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mn51); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mn51); + } +#endif + rate_He4_Mn51_to_p_Fe54_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Mn51_to_p_Fe54_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mn51_to_p_Fe54_reaclib) = drate_dT; + } + } + + { + // He4_Mn52_to_p_Fe55_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Mn52); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Mn52); + } +#endif + rate_He4_Mn52_to_p_Fe55_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Mn52_to_p_Fe55_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Mn52_to_p_Fe55_reaclib) = drate_dT; + } + } + + { + // n_Fe52_to_p_Mn52_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Fe52_to_p_Mn52_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Fe52_to_p_Mn52_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Fe52_to_p_Mn52_reaclib) = drate_dT; + } + } + + { + // He4_Fe53_to_p_Co56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Fe53); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Fe53); + } +#endif + rate_He4_Fe53_to_p_Co56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Fe53_to_p_Co56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Fe53_to_p_Co56_reaclib) = drate_dT; + } + } + + { + // n_Co55_to_p_Fe55_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Co55_to_p_Fe55_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Co55_to_p_Fe55_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Co55_to_p_Fe55_reaclib) = drate_dT; + } + } + + { + // n_Co55_to_He4_Mn52_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Co55_to_He4_Mn52_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Co55_to_He4_Mn52_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Co55_to_He4_Mn52_reaclib) = drate_dT; + } + } + + { + // He4_Co55_to_p_Ni58_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_He4_Co55); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_He4_Co55); + } +#endif + rate_He4_Co55_to_p_Ni58_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_He4_Co55_to_p_Ni58_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_He4_Co55_to_p_Ni58_reaclib) = drate_dT; + } + } + + { + // n_Co56_to_p_Fe56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Co56_to_p_Fe56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Co56_to_p_Fe56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Co56_to_p_Fe56_reaclib) = drate_dT; + } + } + + { + // p_Co57_to_He4_Fe54_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Co57); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Co57); + } +#endif + rate_p_Co57_to_He4_Fe54_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Co57_to_He4_Fe54_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Co57_to_He4_Fe54_reaclib) = drate_dT; + } + } + + { + // n_Ni56_to_p_Co56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Ni56_to_p_Co56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Ni56_to_p_Co56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Ni56_to_p_Co56_reaclib) = drate_dT; + } + } + + { + // n_Ni56_to_He4_Fe53_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Ni56_to_He4_Fe53_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Ni56_to_He4_Fe53_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Ni56_to_He4_Fe53_reaclib) = drate_dT; + } + } + + { + // n_Ni57_to_p_Co57_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Ni57_to_p_Co57_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Ni57_to_p_Co57_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Ni57_to_p_Co57_reaclib) = drate_dT; + } + } + + { + // n_Ni57_to_He4_Fe54_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Ni57_to_He4_Fe54_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Ni57_to_He4_Fe54_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Ni57_to_He4_Fe54_reaclib) = drate_dT; + } + } + + { + // n_Ni58_to_He4_Fe55_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Ni58_to_He4_Fe55_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Ni58_to_He4_Fe55_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Ni58_to_He4_Fe55_reaclib) = drate_dT; + } + } + + { + // n_Cu59_to_He4_Co56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Cu59_to_He4_Co56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Cu59_to_He4_Co56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Cu59_to_He4_Co56_reaclib) = drate_dT; + } + } + + { + // p_Cu59_to_He4_Ni56_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; +#ifdef SCREENING + log_scor = rate_eval.log_screen(k_p_Cu59); + if constexpr (std::is_same_v) { + dlog_scor_dT = rate_eval.dlog_screen_dT(k_p_Cu59); + } +#endif + rate_p_Cu59_to_He4_Ni56_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_p_Cu59_to_He4_Ni56_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_p_Cu59_to_He4_Ni56_reaclib) = drate_dT; + } + } + + { + // n_Zn60_to_He4_Ni57_reaclib + + amrex::Real log_scor {0.0_rt}; + amrex::Real dlog_scor_dT {0.0_rt}; + rate_n_Zn60_to_He4_Ni57_reaclib(tfactors, log_scor, dlog_scor_dT, rate, drate_dT); + rate_eval.screened_rates(k_n_Zn60_to_He4_Ni57_reaclib) = rate; + if constexpr (std::is_same_v) { + rate_eval.dscreened_rates_dT(k_n_Zn60_to_He4_Ni57_reaclib) = drate_dT; + } + } + + +} + +#endif diff --git a/networks/he-burn/ase-big/table_rates.H b/networks/he-burn/ase-big/table_rates.H new file mode 100644 index 000000000..5b7c503fe --- /dev/null +++ b/networks/he-burn/ase-big/table_rates.H @@ -0,0 +1,1008 @@ +#ifndef TABLE_RATES_H +#define TABLE_RATES_H + +#include +#include +#include +#include + +#include +#include +#include + +using namespace amrex::literals; + + +// Table is expected to be in terms of dens*ye and temp (logarithmic, cgs units) +// Table energy units are expected in terms of ergs + +// all tables are expected to have columns: +// Log(rhoY) Log(T) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +// Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +// + +const int num_tables = 16; + +enum TableVars : std::uint8_t +{ + jtab_rate = 1, + jtab_nuloss = 2, + jtab_gamma = 3, + num_vars = jtab_gamma +}; + + +struct table_t +{ + int ntemp; + int nrhoy; + int nvars; + int nheader; +}; + +// we add an additional index, k_index_dlogr_dlogt used for computing +// the derivative of Log(rate) with respect of Log(temperature) by +// using the table values. It isn't an index into the table but into +// the 'entries' array. Is important to mention that although we +// compute dlogr/dlogT as the computed quantity in 'entries', we +// pursue ultimately dr/dt as the final desired quantity to be +// computed for this index. + +constexpr int k_index_dlogr_dlogt = num_vars + 1; +constexpr int add_vars = 1; // 1 Additional Var in entries + + +namespace rate_tables +{ + // Fe52 --> Mn52 + inline AMREX_GPU_DEVICE table_t j_Fe52_Mn52_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Fe52_Mn52_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Fe52_Mn52_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Fe52_Mn52_data{ +-4.906371, -4.906798, -4.906854, -4.906891, -4.906609, -4.897636, -4.761613, -4.431111, -3.729626, -2.622547, -0.832892, 1.80361, 4.539039, // RATE +-4.901046, -4.904987, -4.905541, -4.905913, -4.905988, -4.897257, -4.761255, -4.431111, -3.729626, -2.622547, -0.832892, 1.80361, 4.539039, +-4.864689, -4.887545, -4.892723, -4.896275, -4.898122, -4.892652, -4.758714, -4.429863, -3.728935, -2.622547, -0.832892, 1.80361, 4.539039, +-4.724129, -4.759167, -4.786462, -4.811272, -4.825801, -4.829573, -4.729103, -4.416675, -3.72547, -2.621701, -0.832892, 1.80361, 4.539039, +-4.345611, -4.350678, -4.36503, -4.398698, -4.433226, -4.449617, -4.427399, -4.270087, -3.688441, -2.614767, -0.83205, 1.80361, 4.539039, +-3.646483, -3.646483, -3.646483, -3.645538, -3.645538, -3.642592, -3.622249, -3.56841, -3.348444, -2.545704, -0.824464, 1.804597, 4.539039, +-2.623732, -2.623732, -2.622737, -2.619753, -2.612789, -2.601834, -2.57069, -2.521836, -2.377866, -2.012814, -0.750395, 1.807572, 4.539039, +-1.144925, -1.144925, -1.144925, -1.142925, -1.138926, -1.131927, -1.114919, -1.087884, -1.005741, -0.793974, -0.176013, 1.838214, 4.540038, +0.776001, 0.776001, 0.776001, 0.776001, 0.778001, 0.780001, 0.785001, 0.793002, 0.821004, 0.896021, 1.152744, 2.122827, 4.548038, +2.767, 2.767, 2.767, 2.767, 2.768, 2.768, 2.769, 2.771, 2.779, 2.798, 2.864014, 3.209242, 4.631033, +4.606, 4.607, 4.607, 4.607, 4.607, 4.607, 4.607, 4.608, 4.611, 4.619, 4.638, 4.728007, 5.23601, +-11.03529, -11.03729, -11.03729, -11.03729, -11.03629, -11.00229, -10.65229, -10.11329, -9.23929, -7.97729, -5.94629, -2.88329, 0.3697104, // NU +-11.01429, -11.03029, -11.03229, -11.03329, -11.03329, -11.00129, -10.65129, -10.11329, -9.23929, -7.97729, -5.94629, -2.88329, 0.3697104, +-10.89029, -10.96529, -10.98329, -10.99629, -11.00229, -10.98329, -10.64529, -10.11029, -9.23929, -7.97729, -5.94629, -2.88329, 0.3697104, +-10.55029, -10.62029, -10.68029, -10.73729, -10.77129, -10.77829, -10.57429, -10.08929, -9.23429, -7.97629, -5.94629, -2.88329, 0.3697104, +-9.97329, -9.97929, -9.99629, -10.03529, -10.07329, -10.08829, -10.05629, -9.87329, -9.18929, -7.96929, -5.94529, -2.88329, 0.3697104, +-9.17129, -9.17129, -9.17029, -9.16829, -9.16229, -9.15229, -9.12029, -9.05329, -8.80329, -7.89729, -5.93729, -2.88329, 0.3697104, +-8.07929, -8.07929, -8.07829, -8.07629, -8.06829, -8.05529, -8.02229, -7.96429, -7.79229, -7.35029, -5.86029, -2.88029, 0.3697104, +-6.57029, -6.57029, -6.57029, -6.56829, -6.56329, -6.55529, -6.53429, -6.49929, -6.39029, -6.10929, -5.27129, -2.84929, 0.3707104, +-4.49429, -4.49429, -4.49429, -4.49329, -4.49229, -4.48929, -4.48129, -4.46829, -4.42729, -4.31429, -3.90829, -2.56029, 0.3797104, +-2.16729, -2.16729, -2.16729, -2.16729, -2.16629, -2.16629, -2.16429, -2.16129, -2.15029, -2.12029, -2.00929, -1.43529, 0.4627104, +0.05071039, 0.05071039, 0.05071039, 0.05071039, 0.05071039, 0.05071039, 0.05171039, 0.05271039, 0.05671039, 0.06671039, 0.09671039, 0.2557104, 1.08271, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Mn52 --> Fe52 + inline AMREX_GPU_DEVICE table_t j_Mn52_Fe52_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Mn52_Fe52_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Mn52_Fe52_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Mn52_Fe52_data{ +-99.69797, -99.69797, -65.878999, -34.575999, -21.223979, -16.637548, -12.902767, -10.876369, -8.54894, -6.111587, -3.357602, 0.086907, 2.997066, // RATE +-99.69797, -99.69797, -66.878991, -35.57599, -21.636945, -16.659524, -12.904747, -10.876369, -8.54894, -6.111587, -3.357602, 0.086907, 2.997066, +-99.69797, -99.69797, -67.884909, -36.577904, -22.585514, -16.865235, -12.918609, -10.879282, -8.549845, -6.111587, -3.357602, 0.086907, 2.997066, +-99.69797, -99.69797, -68.939242, -37.595027, -23.587165, -17.682996, -13.05895, -10.910356, -8.55437, -6.112379, -3.358458, 0.086907, 2.997066, +-99.69797, -99.69797, -70.44057, -38.755622, -24.611309, -18.672411, -13.768558, -11.186361, -8.602228, -6.119698, -3.358458, 0.086907, 2.997066, +-99.69797, -99.69797, -74.569326, -40.740467, -25.856878, -19.72247, -14.722783, -12.019551, -8.976286, -6.183462, -3.366296, 0.085916, 2.997066, +-99.69797, -99.69797, -86.144034, -46.348208, -28.983741, -21.874085, -16.11579, -13.058624, -9.73541, -6.592597, -3.441311, 0.082943, 2.997066, +-99.69797, -99.69797, -99.69797, -61.031619, -37.004096, -27.162257, -19.322803, -15.283558, -11.059626, -7.401889, -3.952836, 0.052156, 2.996066, +-99.69797, -99.69797, -99.69797, -94.456315, -55.719188, -40.058053, -27.715805, -21.434493, -15.005355, -9.636686, -5.172733, -0.236371, 2.988067, +-99.69797, -99.69797, -99.69797, -99.69797, -98.192171, -69.714505, -47.409367, -36.161175, -24.777483, -15.452579, -8.060174, -1.42542, 2.905077, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -90.398471, -68.385315, -46.237758, -28.305639, -14.471615, -3.734758, 2.273161, +-105.7943, -105.7943, -72.94829, -41.33329, -27.72429, -22.96929, -19.04129, -16.86929, -14.31929, -11.60829, -8.51829, -4.59729, -1.17729, // NU +-105.7943, -105.7943, -73.94929, -42.33329, -28.13729, -22.99129, -19.04229, -16.87029, -14.31929, -11.60829, -8.51829, -4.59729, -1.17729, +-105.7943, -105.7943, -74.95429, -43.33529, -29.08529, -23.19729, -19.05729, -16.87329, -14.31929, -11.60829, -8.51829, -4.59729, -1.17729, +-105.7943, -105.7943, -76.00929, -44.35129, -30.08529, -24.01529, -19.19729, -16.90329, -14.32429, -11.60929, -8.51829, -4.59729, -1.17729, +-105.7943, -105.7943, -77.51229, -45.50129, -31.10229, -25.00929, -19.91229, -17.18229, -14.37329, -11.61629, -8.51929, -4.59729, -1.17729, +-105.7943, -105.7943, -81.58629, -47.43329, -32.36529, -26.09429, -20.90229, -18.03929, -14.76129, -11.68729, -8.52729, -4.59729, -1.17729, +-105.7943, -105.7943, -93.19229, -53.12729, -35.55029, -28.28329, -22.30329, -19.09929, -15.57729, -12.15829, -8.60929, -4.60029, -1.17729, +-105.7943, -105.7943, -105.7943, -67.82529, -43.51629, -33.50829, -25.50329, -21.34229, -16.95529, -13.09529, -9.19329, -4.63229, -1.17829, +-105.7943, -105.7943, -105.7943, -101.2463, -62.27229, -46.46029, -33.94029, -27.53629, -20.94729, -15.39129, -10.57629, -4.92429, -1.18629, +-105.7943, -105.7943, -105.7943, -105.7943, -104.7483, -76.11429, -53.64229, -42.27729, -30.73329, -21.21629, -13.51229, -6.12429, -1.27029, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -96.62829, -74.49729, -52.18929, -34.06129, -19.92429, -8.44429, -1.90429, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Co55 --> Fe55 + inline AMREX_GPU_DEVICE table_t j_Co55_Fe55_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co55_Fe55_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co55_Fe55_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Co55_Fe55_data{ +-5.121806, -5.121938, -5.121955, -5.121967, -5.12188, -5.119711, -5.091033, -4.982213, -4.404988, -3.029783, -0.975611, 1.855007, 4.619042, // RATE +-5.120151, -5.121377, -5.12155, -5.121665, -5.121688, -5.119592, -5.090962, -4.982213, -4.404988, -3.029783, -0.975611, 1.855007, 4.619042, +-5.108479, -5.115894, -5.117538, -5.118665, -5.11925, -5.118146, -5.089878, -4.98141, -4.404416, -3.029783, -0.975611, 1.855007, 4.619042, +-5.056866, -5.070726, -5.081149, -5.090175, -5.095368, -5.097262, -5.077914, -4.971877, -4.401549, -3.02917, -0.975611, 1.855007, 4.619042, +-4.863194, -4.866323, -4.875542, -4.895681, -4.915299, -4.925328, -4.926055, -4.871559, -4.370505, -3.024252, -0.974772, 1.855007, 4.619042, +-4.323733, -4.323733, -4.322892, -4.322892, -4.32205, -4.319524, -4.307701, -4.279443, -4.069278, -2.971522, -0.967209, 1.855007, 4.620042, +-3.346653, -3.346653, -3.34567, -3.343703, -3.337803, -3.327965, -3.302371, -3.261852, -3.116208, -2.509281, -0.892463, 1.857979, 4.620042, +-1.816785, -1.815785, -1.815785, -1.813786, -1.80679, -1.796795, -1.769807, -1.728821, -1.602703, -1.220343, -0.308157, 1.888732, 4.620042, +0.654001, 0.654001, 0.654001, 0.655001, 0.657001, 0.660001, 0.667001, 0.677001, 0.705001, 0.789026, 1.09462, 2.176008, 4.629041, +2.827, 2.827, 2.827, 2.827, 2.828, 2.828, 2.829, 2.83, 2.833, 2.844, 2.89801, 3.27017, 4.711036, +4.688, 4.688, 4.688, 4.688, 4.689, 4.689, 4.689, 4.689, 4.689, 4.691, 4.702, 4.800005, 5.317011, +-11.03229, -11.03229, -11.03229, -11.03229, -11.03229, -11.02629, -10.94929, -10.70929, -9.89329, -8.40129, -6.11729, -2.84329, 0.4487104, // NU +-11.02829, -11.03129, -11.03129, -11.03229, -11.03229, -11.02629, -10.94929, -10.70929, -9.89329, -8.40129, -6.11729, -2.84329, 0.4487104, +-10.99829, -11.01729, -11.02129, -11.02429, -11.02529, -11.02229, -10.94629, -10.70729, -9.89329, -8.40129, -6.11729, -2.84329, 0.4487104, +-10.87929, -10.90929, -10.93229, -10.95329, -10.96429, -10.96829, -10.91729, -10.69129, -9.88929, -8.40029, -6.11729, -2.84329, 0.4487104, +-10.53529, -10.53929, -10.55329, -10.58229, -10.61129, -10.62329, -10.61729, -10.52129, -9.85529, -8.39529, -6.11629, -2.84329, 0.4487104, +-9.84529, -9.84529, -9.84429, -9.84329, -9.83929, -9.83129, -9.81029, -9.77029, -9.53029, -8.34329, -6.10929, -2.84329, 0.4487104, +-8.78829, -8.78829, -8.78729, -8.78529, -8.77829, -8.76629, -8.73929, -8.69929, -8.55729, -7.88629, -6.03129, -2.84029, 0.4487104, +-7.28329, -7.28329, -7.28229, -7.28029, -7.27429, -7.26429, -7.24029, -7.20429, -7.08629, -6.63229, -5.44129, -2.80929, 0.4497104, +-4.75929, -4.75929, -4.75929, -4.75829, -4.75529, -4.75029, -4.73829, -4.72229, -4.67729, -4.53829, -4.02529, -2.51929, 0.4587104, +-2.13929, -2.13929, -2.13929, -2.13929, -2.13829, -2.13829, -2.13629, -2.13429, -2.12829, -2.10729, -2.00729, -1.38629, 0.5417104, +0.1267104, 0.1267104, 0.1267104, 0.1267104, 0.1267104, 0.1267104, 0.1277104, 0.1277104, 0.1287104, 0.1317104, 0.1507104, 0.3217104, 1.16171, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Fe55 --> Co55 + inline AMREX_GPU_DEVICE table_t j_Fe55_Co55_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Fe55_Co55_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Fe55_Co55_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Fe55_Co55_data{ +-99.69797, -99.69797, -92.415981, -47.517995, -28.342991, -21.427754, -15.876279, -12.929251, -9.569698, -6.204919, -3.169744, 0.133879, 2.923101, // RATE +-99.69797, -99.69797, -93.415809, -48.517953, -28.756976, -21.448741, -15.878248, -12.929251, -9.569698, -6.204919, -3.169744, 0.133879, 2.923101, +-99.69797, -99.69797, -94.4201, -49.519533, -29.704789, -21.654584, -15.892029, -12.931994, -9.569698, -6.204919, -3.169744, 0.133879, 2.923101, +-99.69797, -99.69797, -95.459303, -50.533517, -30.708912, -22.474268, -16.031385, -12.96115, -9.57313, -6.205289, -3.169744, 0.133879, 2.923101, +-99.69797, -99.69797, -96.880036, -51.676962, -31.757458, -23.482487, -16.726546, -13.213963, -9.60348, -6.208867, -3.170488, 0.133879, 2.923101, +-99.69797, -99.69797, -99.69797, -53.842509, -33.166626, -24.579526, -17.561432, -13.852876, -9.800935, -6.240189, -3.177424, 0.133879, 2.923101, +-99.69797, -99.69797, -99.69797, -59.199051, -35.743864, -26.178485, -18.555864, -14.511279, -10.13398, -6.423741, -3.243258, 0.130902, 2.923101, +-99.69797, -99.69797, -99.69797, -72.87941, -42.933494, -30.797462, -21.18138, -16.25527, -11.202808, -7.049835, -3.685212, 0.100167, 2.922102, +-99.69797, -99.69797, -99.69797, -99.69797, -61.931899, -43.925887, -29.766858, -22.593819, -15.314674, -9.398964, -4.871983, -0.186896, 2.914103, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -73.706921, -49.588899, -37.43687, -25.180768, -15.28859, -7.797651, -1.373922, 2.832117, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -92.617907, -69.703881, -46.685789, -28.186741, -14.247059, -3.681334, 2.201262, +-105.7943, -105.7943, -99.48629, -54.27829, -34.84629, -27.76129, -22.01029, -18.91129, -15.31829, -11.73529, -8.31929, -4.52729, -1.23729, // NU +-105.7943, -105.7943, -100.4873, -55.27829, -35.25929, -27.78329, -22.01129, -18.91129, -15.31829, -11.73529, -8.31929, -4.52729, -1.23729, +-105.7943, -105.7943, -101.4913, -56.27929, -36.20729, -27.98929, -22.02629, -18.91429, -15.31929, -11.73529, -8.31929, -4.52729, -1.23729, +-105.7943, -105.7943, -102.5333, -57.29529, -37.21129, -28.80729, -22.16429, -18.94329, -15.32229, -11.73529, -8.31929, -4.52729, -1.23729, +-105.7943, -105.7943, -103.9783, -58.44929, -38.25929, -29.80829, -22.85229, -19.19329, -15.35329, -11.74029, -8.32029, -4.52729, -1.23729, +-105.7943, -105.7943, -105.7943, -60.60929, -39.64929, -30.86129, -23.66429, -19.82029, -15.56229, -11.78529, -8.32829, -4.52729, -1.23729, +-105.7943, -105.7943, -105.7943, -65.88029, -42.19829, -32.51429, -24.70329, -20.47229, -15.92629, -12.05729, -8.40629, -4.53029, -1.23729, +-105.7943, -105.7943, -105.7943, -79.56929, -49.42729, -37.15029, -27.36129, -22.32029, -17.12129, -12.79529, -8.96229, -4.56129, -1.23829, +-105.7943, -105.7943, -105.7943, -105.7943, -68.47329, -50.31829, -35.99629, -28.71229, -21.28129, -15.18829, -10.31929, -4.85329, -1.24629, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -80.10929, -55.82629, -43.56029, -31.14929, -21.07529, -13.28029, -6.05329, -1.33029, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -98.85329, -75.82429, -52.65029, -33.96729, -19.72329, -8.37229, -1.96429, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Co56 --> Fe56 + inline AMREX_GPU_DEVICE table_t j_Co56_Fe56_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co56_Fe56_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co56_Fe56_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Co56_Fe56_data{ +-7.705836, -7.707962, -7.692263, -7.032866, -6.284874, -5.970341, -5.642062, -5.178082, -4.093715, -2.791284, -1.100233, 1.756545, 4.567038, // RATE +-7.679753, -7.698752, -7.685687, -7.03166, -6.284674, -5.970255, -5.642021, -5.178082, -4.093715, -2.791284, -1.100233, 1.756545, 4.567038, +-7.527841, -7.617156, -7.625169, -7.019812, -6.282127, -5.969199, -5.641444, -5.177793, -4.093715, -2.791284, -1.100233, 1.756545, 4.567038, +-7.143978, -7.218464, -7.274399, -6.91746, -6.257215, -5.953899, -5.634532, -5.174694, -4.09303, -2.791062, -1.100233, 1.756545, 4.567038, +-6.531161, -6.535828, -6.547748, -6.451858, -6.068661, -5.819785, -5.540428, -5.135174, -4.086733, -2.789275, -1.099233, 1.756545, 4.567038, +-5.665057, -5.665057, -5.661938, -5.615084, -5.425421, -5.254582, -5.034578, -4.780142, -4.003284, -2.769201, -1.092706, 1.756545, 4.567038, +-4.358806, -4.357806, -4.3558, -4.333132, -4.232138, -4.12281, -3.965142, -3.811776, -3.421915, -2.535933, -1.027814, 1.759514, 4.567038, +-2.446998, -2.445998, -2.444998, -2.437989, -2.402943, -2.360894, -2.288815, -2.213574, -2.025688, -1.520319, -0.491245, 1.790233, 4.568038, +0.248, 0.248, 0.249, 0.25, 0.252, 0.256, 0.266001, 0.281001, 0.324015, 0.456193, 0.881313, 2.077294, 4.576037, +2.669, 2.669, 2.669, 2.669, 2.669, 2.668, 2.668, 2.669, 2.673, 2.688001, 2.759017, 3.178192, 4.659032, +4.604, 4.604, 4.604, 4.604, 4.603, 4.603, 4.603, 4.603, 4.603, 4.605, 4.619, 4.727005, 5.26501, +-13.59829, -13.60129, -13.57029, -12.69229, -11.90729, -11.58929, -11.24329, -10.68229, -9.47729, -8.07929, -6.19029, -2.94129, 0.3947104, // NU +-13.57129, -13.59129, -13.56429, -12.69129, -11.90729, -11.58929, -11.24329, -10.68229, -9.47729, -8.07929, -6.19029, -2.94129, 0.3947104, +-13.41529, -13.50629, -13.50229, -12.68329, -11.90529, -11.58829, -11.24229, -10.68229, -9.47729, -8.07929, -6.19029, -2.94129, 0.3947104, +-13.02429, -13.09829, -13.14829, -12.61229, -11.88529, -11.57529, -11.23529, -10.67929, -9.47629, -8.07929, -6.19029, -2.94129, 0.3947104, +-12.40329, -12.40729, -12.41729, -12.23429, -11.73129, -11.45429, -11.14429, -10.64329, -9.46929, -8.07729, -6.19029, -2.94129, 0.3947104, +-11.51229, -11.51029, -11.50729, -11.42629, -11.13829, -10.91629, -10.64429, -10.31029, -9.38529, -8.05029, -6.18329, -2.94029, 0.3947104, +-10.14129, -10.14029, -10.13829, -10.10029, -9.94129, -9.78429, -9.57229, -9.35929, -8.81329, -7.77029, -6.11129, -2.93729, 0.3947104, +-8.08729, -8.08629, -8.08529, -8.07329, -8.01829, -7.95229, -7.84929, -7.74329, -7.46929, -6.76429, -5.55229, -2.90629, 0.3957104, +-5.23029, -5.23029, -5.22929, -5.22829, -5.22229, -5.21329, -5.19529, -5.17029, -5.09929, -4.87429, -4.20629, -2.61629, 0.4037104, +-2.34029, -2.34029, -2.34029, -2.34029, -2.34029, -2.34029, -2.33929, -2.33729, -2.33029, -2.30229, -2.16929, -1.48329, 0.4867104, +0.02371039, 0.02371039, 0.02371039, 0.02371039, 0.02371039, 0.02271039, 0.02271039, 0.02271039, 0.02371039, 0.02771039, 0.05271039, 0.2397104, 1.10771, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Co56 --> Ni56 + inline AMREX_GPU_DEVICE table_t j_Co56_Ni56_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co56_Ni56_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co56_Ni56_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Co56_Ni56_data{ +-99.69797, -99.69797, -69.758981, -37.768387, -23.052703, -17.76895, -13.4835, -11.090722, -8.426201, -6.028675, -3.404715, 0.008204, 2.897241, // RATE +-99.69797, -99.69797, -69.758998, -37.91085, -23.428328, -17.788058, -13.48505, -11.090722, -8.426201, -6.028675, -3.404715, 0.008204, 2.897241, +-99.69797, -99.69797, -69.76, -37.929051, -24.062933, -17.970447, -13.496085, -11.092307, -8.426201, -6.028675, -3.404715, 0.008204, 2.897241, +-99.69797, -99.69797, -69.773, -37.938809, -24.275558, -18.541193, -13.600964, -11.108896, -8.428553, -6.028675, -3.404715, 0.008204, 2.897241, +-99.69797, -99.69797, -69.87, -38.016985, -24.35695, -18.824908, -13.980828, -11.234267, -8.446387, -6.033804, -3.405601, 0.008204, 2.897241, +-99.69797, -99.69797, -70.529, -38.608, -24.815753, -19.175805, -14.229062, -11.447153, -8.563413, -6.077307, -3.4128, 0.008204, 2.897241, +-99.69797, -99.69797, -80.67, -43.872, -27.608968, -20.520799, -14.782228, -11.862087, -8.885633, -6.35384, -3.49073, 0.005223, 2.897241, +-99.69797, -99.69797, -99.69797, -57.166, -34.496, -25.279993, -17.977924, -14.248711, -10.427337, -7.230557, -4.034886, -0.025538, 2.896241, +-99.69797, -99.69797, -99.69797, -91.26, -53.829, -38.713997, -26.825968, -20.800883, -14.679373, -9.649275, -5.349182, -0.314835, 2.888245, +-99.69797, -99.69797, -99.69797, -99.69797, -96.456875, -68.515998, -46.652977, -35.641916, -24.534564, -15.515939, -8.277386, -1.500293, 2.805283, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -89.673979, -67.899925, -46.030612, -28.401609, -14.685801, -3.782003, 2.173693, +-105.7943, -105.7943, -76.12229, -43.95729, -28.97729, -23.66129, -19.31729, -16.89029, -14.16229, -11.51229, -8.55129, -4.67829, -1.27329, // NU +-105.7943, -105.7943, -76.12329, -44.24529, -29.37629, -23.68129, -19.31829, -16.89129, -14.16229, -11.51229, -8.55129, -4.67829, -1.27329, +-105.7943, -105.7943, -76.12429, -44.28929, -30.17529, -23.87829, -19.33129, -16.89329, -14.16329, -11.51229, -8.55129, -4.67829, -1.27329, +-105.7943, -105.7943, -76.14229, -44.30529, -30.58529, -24.58029, -19.44629, -16.91229, -14.16629, -11.51329, -8.55129, -4.67829, -1.27329, +-105.7943, -105.7943, -76.27929, -44.41029, -30.72629, -25.06929, -19.90129, -17.06829, -14.19329, -11.51929, -8.55229, -4.67829, -1.27329, +-105.7943, -105.7943, -77.17829, -45.18429, -31.29129, -25.48729, -20.20929, -17.35229, -14.37729, -11.58329, -8.56029, -4.67929, -1.27329, +-105.7943, -105.7943, -87.74329, -50.66029, -33.96729, -26.67329, -20.84629, -17.87129, -14.80829, -12.00229, -8.64429, -4.68229, -1.27329, +-105.7943, -105.7943, -105.7943, -63.96229, -41.05829, -31.69429, -24.23329, -20.39929, -16.43629, -13.01329, -9.24929, -4.71329, -1.27429, +-105.7943, -105.7943, -105.7943, -98.05129, -60.38529, -45.12229, -33.06929, -26.93229, -20.66129, -15.43829, -10.70929, -5.00529, -1.28329, +-105.7943, -105.7943, -105.7943, -105.7943, -103.0123, -74.92229, -52.89529, -41.77129, -30.51129, -21.29929, -13.69229, -6.20429, -1.36629, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -95.91429, -74.02629, -52.00129, -34.17629, -20.10129, -8.50729, -2.00029, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Fe56 --> Co56 + inline AMREX_GPU_DEVICE table_t j_Fe56_Co56_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Fe56_Co56_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Fe56_Co56_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Fe56_Co56_data{ +-99.69797, -99.69797, -99.69797, -62.854802, -37.268611, -27.644755, -19.855923, -15.693996, -11.062186, -6.68628, -2.996418, 0.330264, 3.050101, // RATE +-99.69797, -99.69797, -99.69797, -63.853019, -37.680995, -27.666587, -19.856877, -15.693996, -11.062186, -6.68628, -2.996418, 0.330264, 3.050101, +-99.69797, -99.69797, -99.69797, -64.836633, -38.621182, -27.870529, -19.871187, -15.697494, -11.062186, -6.68628, -2.996418, 0.330264, 3.050101, +-99.69797, -99.69797, -99.69797, -65.7102, -39.55548, -28.663301, -20.004525, -15.724463, -11.06592, -6.686696, -2.997055, 0.330264, 3.050101, +-99.69797, -99.69797, -99.69797, -66.280944, -40.233201, -29.472432, -20.635643, -15.962004, -11.09846, -6.690003, -2.997418, 0.330264, 3.050101, +-99.69797, -99.69797, -99.69797, -67.639813, -41.062948, -30.122111, -21.260917, -16.518405, -11.315505, -6.724397, -3.003133, 0.330264, 3.050101, +-99.69797, -99.69797, -99.69797, -73.044885, -43.824626, -31.873401, -22.193492, -17.093479, -11.651187, -6.909866, -3.060643, 0.327313, 3.050101, +-99.69797, -99.69797, -99.69797, -87.073958, -51.036924, -36.357882, -24.714784, -18.729642, -12.542089, -7.403073, -3.424626, 0.296708, 3.049101, +-99.69797, -99.69797, -99.69797, -99.69797, -69.154998, -48.719996, -32.644989, -24.496976, -16.231906, -9.513029, -4.483336, 0.010989, 3.041103, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -78.494997, -52.453992, -39.326983, -26.089934, -15.400331, -7.403972, -1.170819, 2.959117, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -95.484987, -71.596985, -47.59994, -28.306391, -13.865952, -3.478059, 2.328257, +-105.7943, -105.7943, -105.7943, -69.58329, -43.73429, -33.92829, -25.92829, -21.62029, -16.78829, -12.21529, -8.20029, -4.32829, -1.10729, // NU +-105.7943, -105.7943, -105.7943, -70.58129, -44.14629, -33.94929, -25.92929, -21.62029, -16.78829, -12.21529, -8.20029, -4.32829, -1.10729, +-105.7943, -105.7943, -105.7943, -71.56029, -45.08829, -34.15429, -25.94329, -21.62329, -16.78929, -12.21629, -8.20029, -4.32829, -1.10729, +-105.7943, -105.7943, -105.7943, -72.39829, -46.03329, -34.95229, -26.07829, -21.65129, -16.79229, -12.21629, -8.20029, -4.32829, -1.10729, +-105.7943, -105.7943, -105.7943, -72.93929, -46.75229, -35.79129, -26.72229, -21.89129, -16.82529, -12.22029, -8.20129, -4.32829, -1.10729, +-105.7943, -105.7943, -105.7943, -74.45329, -47.60029, -36.46829, -27.38129, -22.45629, -17.04429, -12.26129, -8.20829, -4.32829, -1.10729, +-105.7943, -105.7943, -105.7943, -79.85329, -50.39029, -38.21729, -28.28029, -23.02529, -17.39629, -12.48929, -8.28029, -4.33129, -1.10729, +-105.7943, -105.7943, -105.7943, -93.83229, -57.48829, -42.65529, -30.83529, -24.72029, -18.37029, -13.06929, -8.76429, -4.36229, -1.10829, +-105.7943, -105.7943, -105.7943, -105.7943, -75.70329, -55.11629, -38.87129, -30.60529, -22.18229, -15.28229, -9.98429, -4.65329, -1.11629, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -84.89429, -58.68529, -45.44229, -32.04829, -21.17629, -12.92829, -5.85229, -1.19929, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -101.7163, -77.71229, -53.55729, -34.07929, -19.38129, -8.17129, -1.83329, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Ni56 --> Co56 + inline AMREX_GPU_DEVICE table_t j_Ni56_Co56_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Ni56_Co56_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Ni56_Co56_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Ni56_Co56_data{ +-8.684, -9.164, -9.291, -9.387, -8.777, -7.439, -6.183988, -5.405627, -4.316341, -2.714602, -0.608944, 2.014581, 4.728024, // RATE +-7.705, -8.165, -8.291, -8.387, -8.364, -7.418, -6.181989, -5.405627, -4.316341, -2.714602, -0.608944, 2.014581, 4.728024, +-6.834, -7.171, -7.293, -7.388, -7.417, -7.212, -6.167989, -5.40263, -4.315361, -2.714602, -0.608944, 2.014581, 4.728024, +-6.118, -6.22, -6.31, -6.392, -6.418, -6.393, -6.026992, -5.371655, -4.310459, -2.713745, -0.608944, 2.014581, 4.728024, +-5.384, -5.388, -5.399, -5.421, -5.423, -5.395, -5.304998, -5.086821, -4.258432, -2.706884, -0.608116, 2.014581, 4.728024, +-4.448, -4.447, -4.444, -4.432, -4.403, -4.363, -4.278, -4.169978, -3.831179, -2.635446, -0.60148, 2.015573, 4.728024, +-3.134, -3.134, -3.132, -3.127, -3.113, -3.091, -3.039, -2.963999, -2.726778, -2.078197, -0.527602, 2.018548, 4.728024, +-1.311, -1.311, -1.31, -1.305, -1.293, -1.275, -1.232, -1.177, -1.038995, -0.718361, 0.045499, 2.049328, 4.729024, +1.069, 1.069, 1.069, 1.07, 1.071, 1.073, 1.078, 1.085, 1.104, 1.159008, 1.38679, 2.334798, 4.737024, +3.035, 3.034, 3.034, 3.034, 3.035, 3.035, 3.036, 3.037, 3.04, 3.048, 3.084016, 3.420155, 4.819021, +4.825, 4.825, 4.825, 4.825, 4.825, 4.825, 4.826, 4.826, 4.826, 4.827, 4.831, 4.926005, 5.424006, +-14.86129, -15.33229, -15.44729, -15.51729, -14.85829, -13.46429, -12.11329, -11.24729, -10.01729, -8.18129, -5.72329, -2.67829, 0.5607104, // NU +-13.88129, -14.33229, -14.44829, -14.51729, -14.44529, -13.44329, -12.11229, -11.24729, -10.01729, -8.18129, -5.72329, -2.67829, 0.5607104, +-13.00929, -13.33829, -13.44929, -13.51729, -13.49729, -13.23729, -12.09729, -11.24429, -10.01729, -8.18129, -5.72329, -2.67829, 0.5607104, +-12.28929, -12.38529, -12.46529, -12.52029, -12.49829, -12.41829, -11.95629, -11.21229, -10.01129, -8.18029, -5.72329, -2.67829, 0.5607104, +-11.53229, -11.53329, -11.53829, -11.53729, -11.49429, -11.41429, -11.23129, -10.92729, -9.96029, -8.17429, -5.72229, -2.67829, 0.5607104, +-10.50329, -10.50129, -10.49429, -10.47129, -10.41229, -10.33429, -10.17529, -9.99429, -9.53129, -8.10529, -5.71429, -2.67729, 0.5607104, +-8.96329, -8.96229, -8.96029, -8.95129, -8.92729, -8.89229, -8.80929, -8.70029, -8.39729, -7.56129, -5.63729, -2.67429, 0.5607104, +-6.96629, -6.96629, -6.96529, -6.96029, -6.94829, -6.92929, -6.88329, -6.81929, -6.64629, -6.19129, -5.04929, -2.64329, 0.5607104, +-4.27729, -4.27729, -4.27729, -4.27629, -4.27429, -4.27029, -4.26229, -4.25029, -4.21729, -4.11729, -3.68129, -2.35329, 0.5697104, +-1.88929, -1.88929, -1.88929, -1.88929, -1.88829, -1.88829, -1.88729, -1.88529, -1.87929, -1.86429, -1.78229, -1.22629, 0.6527104, +0.2827104, 0.2827104, 0.2827104, 0.2827104, 0.2827104, 0.2827104, 0.2827104, 0.2837104, 0.2847104, 0.2867104, 0.2977104, 0.4587104, 1.27271, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Co57 --> Ni57 + inline AMREX_GPU_DEVICE table_t j_Co57_Ni57_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co57_Ni57_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Co57_Ni57_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Co57_Ni57_data{ +-99.69797, -99.69797, -88.234, -45.683999, -27.505989, -20.983704, -15.721981, -12.875118, -9.537559, -6.213974, -3.030172, 0.374366, 3.150063, // RATE +-99.69797, -99.69797, -89.234, -46.683994, -27.919971, -21.00469, -15.722965, -12.875118, -9.537559, -6.213974, -3.030172, 0.374366, 3.150063, +-99.69797, -99.69797, -90.24, -47.685945, -28.867744, -21.211501, -15.73772, -12.877917, -9.53813, -6.213974, -3.030172, 0.374366, 3.150063, +-99.69797, -99.69797, -91.294999, -48.702438, -29.87145, -22.029733, -15.875982, -12.906587, -9.540975, -6.214398, -3.030172, 0.374366, 3.150063, +-99.69797, -99.69797, -92.797968, -49.867356, -30.914872, -23.033596, -16.56961, -13.153481, -9.571179, -6.217773, -3.030948, 0.374366, 3.150063, +-99.69797, -99.69797, -96.930694, -51.96854, -32.268115, -24.11937, -17.394675, -13.751058, -9.76747, -6.253677, -3.037371, 0.374366, 3.150063, +-99.69797, -99.69797, -99.69797, -57.435409, -34.97184, -25.743974, -18.27794, -14.315685, -10.111652, -6.466007, -3.106717, 0.371381, 3.150063, +-99.69797, -99.69797, -99.69797, -70.893584, -42.038557, -30.283542, -20.972452, -16.217255, -11.316341, -7.157658, -3.572421, 0.340573, 3.149063, +-99.69797, -99.69797, -99.69797, -99.69797, -61.150886, -43.562864, -29.721817, -22.693746, -15.51345, -9.5448, -4.79006, 0.051649, 3.140064, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -73.333907, -49.525875, -37.517826, -25.358626, -15.406922, -7.697326, -1.138969, 3.058073, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -92.523893, -69.749853, -46.825689, -28.260325, -14.091789, -3.447915, 2.426161, +-105.7943, -105.7943, -95.30129, -52.43729, -34.00129, -27.30929, -21.84729, -18.84529, -15.29829, -11.74429, -8.17229, -4.30529, -1.02529, // NU +-105.7943, -105.7943, -96.30129, -53.43729, -34.41429, -27.33029, -21.84829, -18.84529, -15.29829, -11.74429, -8.17229, -4.30529, -1.02529, +-105.7943, -105.7943, -97.30729, -54.43929, -35.36229, -27.53629, -21.86229, -18.84829, -15.29829, -11.74429, -8.17229, -4.30529, -1.02529, +-105.7943, -105.7943, -98.36229, -55.45629, -36.36529, -28.35529, -22.00129, -18.87629, -15.30129, -11.74429, -8.17229, -4.30529, -1.02529, +-105.7943, -105.7943, -99.86529, -56.61529, -37.40429, -29.35429, -22.68529, -19.11829, -15.33329, -11.74929, -8.17329, -4.30529, -1.02529, +-105.7943, -105.7943, -103.9633, -58.68429, -38.75629, -30.41629, -23.46829, -19.68729, -15.54629, -11.80029, -8.18129, -4.30529, -1.02529, +-105.7943, -105.7943, -105.7943, -64.12529, -41.40829, -32.03029, -24.35729, -20.26929, -15.94029, -12.11229, -8.26129, -4.30829, -1.02529, +-105.7943, -105.7943, -105.7943, -77.67829, -48.54829, -36.63729, -27.17229, -22.31329, -17.26729, -12.92229, -8.83129, -4.33929, -1.02629, +-105.7943, -105.7943, -105.7943, -105.7943, -67.70529, -49.96729, -35.95829, -28.81629, -21.48329, -15.33329, -10.21429, -4.63129, -1.03529, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -79.73829, -55.76429, -43.64129, -31.32729, -21.19129, -13.16329, -5.83229, -1.11829, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -98.75729, -75.86829, -52.78529, -34.02729, -19.54729, -8.15129, -1.75329, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Ni57 --> Co57 + inline AMREX_GPU_DEVICE table_t j_Ni57_Co57_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Ni57_Co57_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Ni57_Co57_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Ni57_Co57_data{ +-5.642091, -5.642707, -5.642788, -5.642842, -5.641432, -5.616587, -5.325434, -4.866623, -4.134766, -2.886975, -0.825863, 1.962988, 4.710039, // RATE +-5.6344, -5.64008, -5.640888, -5.641426, -5.640531, -5.616078, -5.325076, -4.866306, -4.134766, -2.886975, -0.825863, 1.962988, 4.710039, +-5.582963, -5.61509, -5.62242, -5.627546, -5.629166, -5.60958, -5.32253, -4.865352, -4.134766, -2.886975, -0.825863, 1.962988, 4.710039, +-5.397838, -5.442289, -5.477623, -5.510333, -5.528545, -5.523486, -5.292865, -4.855231, -4.13149, -2.886231, -0.825863, 1.962988, 4.710039, +-4.95921, -4.964751, -4.980479, -5.016814, -5.05346, -5.067061, -4.990541, -4.738387, -4.102245, -2.88027, -0.82506, 1.962988, 4.710039, +-4.226046, -4.226046, -4.225084, -4.224122, -4.22216, -4.216776, -4.183487, -4.101517, -3.810696, -2.818167, -0.817812, 1.962988, 4.710039, +-3.179504, -3.179504, -3.178507, -3.176514, -3.169534, -3.158521, -3.125742, -3.066253, -2.869053, -2.307218, -0.745818, 1.965961, 4.710039, +-1.640957, -1.640957, -1.639957, -1.636957, -1.626958, -1.612958, -1.574937, -1.517866, -1.361664, -1.003517, -0.173013, 1.996715, 4.711039, +0.856, 0.856, 0.856, 0.857, 0.858, 0.861, 0.867, 0.874001, 0.893002, 0.952016, 1.217801, 2.283003, 4.720038, +2.953, 2.953, 2.953, 2.953, 2.953, 2.953, 2.954, 2.954, 2.953, 2.952, 2.995013, 3.37417, 4.802033, +4.79, 4.79, 4.79, 4.79, 4.79, 4.79, 4.79, 4.789, 4.786, 4.779, 4.782, 4.894005, 5.40701, +-11.75729, -11.75929, -11.76029, -11.76029, -11.75729, -11.67529, -11.07329, -10.47129, -9.64229, -8.26829, -5.96429, -2.73329, 0.5407104, // NU +-11.73129, -11.75029, -11.75329, -11.75529, -11.75429, -11.67329, -11.07329, -10.47129, -9.64229, -8.26829, -5.96429, -2.73329, 0.5407104, +-11.57729, -11.66829, -11.69129, -11.70729, -11.71429, -11.65229, -11.06929, -10.47029, -9.64229, -8.26829, -5.96429, -2.73329, 0.5407104, +-11.19229, -11.26929, -11.33529, -11.40029, -11.43829, -11.42429, -11.02029, -10.45729, -9.63929, -8.26729, -5.96429, -2.73329, 0.5407104, +-10.59129, -10.59829, -10.61529, -10.65629, -10.69429, -10.70329, -10.60329, -10.31329, -9.60529, -8.26129, -5.96329, -2.73329, 0.5407104, +-9.78329, -9.78329, -9.78229, -9.77929, -9.77229, -9.76029, -9.71129, -9.61029, -9.28629, -8.20129, -5.95629, -2.73229, 0.5407104, +-8.67429, -8.67329, -8.67229, -8.66929, -8.66129, -8.64729, -8.60729, -8.53529, -8.31629, -7.70329, -5.88129, -2.72929, 0.5407104, +-7.12629, -7.12529, -7.12529, -7.12229, -7.11529, -7.10429, -7.07229, -7.01629, -6.84729, -6.41929, -5.30229, -2.69829, 0.5417104, +-4.53929, -4.53929, -4.53929, -4.53829, -4.53529, -4.53029, -4.52029, -4.50629, -4.46829, -4.35529, -3.89529, -2.40829, 0.5497104, +-1.99929, -1.99929, -1.99929, -1.99929, -1.99829, -1.99829, -1.99729, -1.99629, -1.99529, -1.98729, -1.90129, -1.27829, 0.6327104, +0.2347104, 0.2347104, 0.2347104, 0.2347104, 0.2347104, 0.2347104, 0.2347104, 0.2337104, 0.2307104, 0.2247104, 0.2357104, 0.4207104, 1.25271, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // n --> p + inline AMREX_GPU_DEVICE table_t j_n_p_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_n_p_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_n_p_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_n_p_data{ +-2.959, -2.959, -2.959, -2.959, -2.958959, -2.957841, -2.941107, -2.874417, -2.540055, -1.720786, -0.41411, 1.802004, 4.347, // RATE +-2.959, -2.959, -2.959, -2.959, -2.958984, -2.957898, -2.941192, -2.874417, -2.540055, -1.720786, -0.41411, 1.802004, 4.347, +-2.959, -2.959, -2.959, -2.959, -2.958998, -2.958314, -2.941776, -2.874975, -2.540055, -1.721736, -0.41411, 1.802004, 4.347, +-2.961, -2.961, -2.961, -2.961, -2.96, -2.959896, -2.947722, -2.881381, -2.544233, -1.721736, -0.41411, 1.802004, 4.347, +-2.98, -2.979, -2.979, -2.978, -2.975, -2.97299, -2.967462, -2.925218, -2.577269, -1.729383, -0.415108, 1.802004, 4.347, +-3.14, -3.14, -3.138, -3.131, -3.116, -3.097999, -3.069766, -3.041782, -2.813017, -1.806664, -0.423096, 1.801004, 4.347, +-5.499, -5.442, -5.306, -4.989, -4.592, -4.297, -3.954978, -3.726186, -3.408689, -2.366458, -0.508967, 1.798004, 4.347, +-99.69797, -65.57, -35.616, -20.209, -13.299, -10.394, -8.019984, -6.772438, -5.436532, -3.791028, -1.150873, 1.768005, 4.346, +-99.69797, -99.69797, -99.69797, -54.663, -33.0, -24.198, -17.245984, -13.71544, -10.109646, -6.677964, -2.765936, 1.478006, 4.338, +-99.69797, -99.69797, -99.69797, -99.69797, -75.759, -54.136, -37.214984, -28.70344, -20.122703, -12.726964, -5.885901, 0.27701, 4.255, +-99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -99.69797, -80.281984, -61.00844, -41.669646, -25.673964, -12.403901, -2.04999, 3.625, +-9.07229, -9.07229, -9.07229, -9.07229, -9.07229, -9.06729, -8.99729, -8.76529, -8.08629, -7.02729, -5.49029, -2.85229, 0.1987104, // NU +-9.07229, -9.07229, -9.07229, -9.07229, -9.07229, -9.06729, -8.99729, -8.76529, -8.08629, -7.02729, -5.49029, -2.85229, 0.1987104, +-9.07229, -9.07229, -9.07229, -9.07229, -9.07229, -9.06929, -9.00029, -8.76729, -8.08729, -7.02729, -5.49029, -2.85229, 0.1987104, +-9.07629, -9.07529, -9.07529, -9.07529, -9.07429, -9.07329, -9.02029, -8.78329, -8.09129, -7.02829, -5.49129, -2.85229, 0.1987104, +-9.10529, -9.10429, -9.10329, -9.10029, -9.09629, -9.09229, -9.07629, -8.90629, -8.13929, -7.03629, -5.49129, -2.85229, 0.1987104, +-9.34529, -9.34329, -9.34029, -9.32529, -9.29529, -9.26229, -9.21529, -9.15329, -8.51229, -7.11629, -5.50029, -2.85229, 0.1987104, +-12.57129, -12.46129, -12.21829, -11.70729, -11.12229, -10.71129, -10.25629, -9.96229, -9.42029, -7.71429, -5.58729, -2.85529, 0.1987104, +-105.7943, -72.95929, -42.71029, -27.01829, -19.88929, -16.85929, -14.36829, -13.05429, -11.53729, -9.20529, -6.23429, -2.88629, 0.1977104, +-105.7943, -105.7943, -105.7943, -61.47129, -39.59029, -30.66429, -23.59429, -19.99829, -16.21129, -12.09729, -7.85229, -3.17929, 0.1897104, +-105.7943, -105.7943, -105.7943, -105.7943, -82.34929, -60.60229, -43.56329, -34.98629, -26.22429, -18.14629, -10.97129, -4.38329, 0.1057104, +-105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -105.7943, -86.63029, -67.29129, -47.77129, -31.09329, -17.48929, -6.71029, -0.5272896, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // p --> n + inline AMREX_GPU_DEVICE table_t j_p_n_meta{.ntemp=13, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_p_n_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_p_n_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121, 11.0}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_p_n_data{ +-99.69797, -49.75, -29.58, -19.262, -14.019, -10.766, -7.99, -6.458, -4.715, -2.968, -1.035, 1.6, 4.293, // RATE +-99.69797, -48.749, -28.58, -18.262, -13.606, -10.744, -7.989, -6.458, -4.715, -2.968, -1.035, 1.6, 4.293, +-99.69797, -47.732, -27.574, -17.26, -12.658, -10.538, -7.974, -6.454, -4.714, -2.968, -1.035, 1.6, 4.293, +-99.69797, -46.572, -26.519, -16.243, -11.652, -9.716, -7.833, -6.423, -4.709, -2.967, -1.035, 1.6, 4.293, +-99.69797, -44.223, -25.017, -15.072, -10.585, -8.685, -7.099, -6.134, -4.656, -2.959, -1.034, 1.6, 4.293, +-99.69797, -36.029, -20.834, -12.798, -9.036, -7.382, -5.962, -5.168, -4.214, -2.876, -1.025, 1.601, 4.293, +-46.082, -10.983, -8.29, -6.487, -5.363, -4.733, -4.066, -3.616, -3.01, -2.27, -0.937, 1.604, 4.293, +-1.35, -1.349, -1.348, -1.345, -1.335, -1.32, -1.285, -1.24, -1.128, -0.875, -0.301, 1.635, 4.294, +0.831, 0.831, 0.832, 0.832, 0.833, 0.835, 0.838, 0.844, 0.859, 0.904, 1.074, 1.922, 4.302, +2.676, 2.676, 2.676, 2.676, 2.676, 2.676, 2.677, 2.678, 2.68, 2.688, 2.725, 3.006, 4.385, +4.416, 4.416, 4.416, 4.416, 4.416, 4.416, 4.416, 4.416, 4.417, 4.419, 4.426, 4.499, 4.989, +-105.7943, -57.12729, -36.65029, -26.02029, -20.51929, -17.09829, -14.12829, -12.45629, -10.51429, -8.51629, -6.24529, -3.09929, 0.1317104, // NU +-105.7943, -56.12529, -35.64929, -25.02029, -20.10629, -17.07729, -14.12729, -12.45629, -10.51429, -8.51629, -6.24529, -3.09929, 0.1317104, +-105.7943, -55.10929, -34.64429, -24.01829, -19.15829, -16.87029, -14.11229, -12.45329, -10.51429, -8.51529, -6.24529, -3.09929, 0.1317104, +-105.7943, -53.94829, -33.58929, -23.00029, -18.15229, -16.04929, -13.97129, -12.42129, -10.50829, -8.51529, -6.24529, -3.09929, 0.1317104, +-105.7943, -51.60029, -32.08629, -21.82929, -17.08529, -15.01729, -13.23729, -12.13329, -10.45529, -8.50629, -6.24429, -3.09929, 0.1317104, +-105.7943, -43.40629, -27.90429, -19.55529, -15.53629, -13.71429, -12.10029, -11.16629, -10.01329, -8.42429, -6.23529, -3.09829, 0.1317104, +-54.46429, -18.35929, -15.35929, -13.24229, -11.85729, -11.05829, -10.19629, -9.60729, -8.80329, -7.81529, -6.14729, -3.09529, 0.1317104, +-7.18529, -7.18529, -7.18329, -7.17629, -7.15829, -7.12929, -7.06529, -6.98329, -6.78729, -6.36929, -5.50229, -3.06429, 0.1327104, +-4.46429, -4.46429, -4.46429, -4.46329, -4.46129, -4.45829, -4.45129, -4.44229, -4.41429, -4.33329, -4.03529, -2.77229, 0.1407104, +-2.21129, -2.21129, -2.21129, -2.21129, -2.21129, -2.21029, -2.20929, -2.20829, -2.20329, -2.18829, -2.12229, -1.63829, 0.2237104, +-0.1062896, -0.1062896, -0.1062896, -0.1062896, -0.1062896, -0.1052896, -0.1052896, -0.1052896, -0.1042896, -0.1012896, -0.08828961, 0.04271039, 0.8437104, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // F18 --> O18 + inline AMREX_GPU_DEVICE table_t j_F18_O18_meta{.ntemp=12, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_F18_O18_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_F18_O18_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_F18_O18_data{ +-4.010762, -4.010915, -4.010933, -4.010943, -4.010771, -4.006329, -3.943745, -3.744878, -3.181896, -2.350694, -1.090264, 1.385945, // RATE +-4.008732, -4.010152, -4.010328, -4.010433, -4.010408, -4.006087, -3.943458, -3.744432, -3.181896, -2.350694, -1.090264, 1.385945, +-3.994387, -4.00269, -4.004356, -4.005377, -4.005786, -4.003132, -3.941413, -3.743091, -3.181076, -2.350694, -1.090264, 1.385945, +-3.927381, -3.940669, -3.950444, -3.958145, -3.961587, -3.961694, -3.916619, -3.7284, -3.176969, -2.349735, -1.090264, 1.385945, +-3.6447, -3.646407, -3.651497, -3.662643, -3.670853, -3.670853, -3.656212, -3.573186, -3.13345, -2.342021, -1.089275, 1.385945, +-2.921167, -2.921167, -2.920248, -2.917491, -2.90921, -2.89907, -2.876731, -2.848819, -2.755735, -2.264755, -1.08135, 1.385945, +-1.851978, -1.851978, -1.850985, -1.848999, -1.844033, -1.83708, -1.820179, -1.803199, -1.774792, -1.709548, -0.996093, 1.388931, +-0.561846, -0.561846, -0.561846, -0.560846, -0.558847, -0.556847, -0.550849, -0.545846, -0.54881, -0.566674, -0.391938, 1.419823, +0.888005, 0.888005, 0.888005, 0.888005, 0.889005, 0.890005, 0.891005, 0.891006, 0.877007, 0.827013, 0.850063, 1.702038, +2.449, 2.449, 2.449, 2.449, 2.449, 2.449, 2.449, 2.448, 2.433, 2.386, 2.360002, 2.754102, +4.072, 4.072, 4.072, 4.072, 4.072, 4.072, 4.072, 4.071, 4.062, 4.032, 4.009, 4.192004, +-10.22229, -10.22229, -10.22229, -10.22229, -10.22229, -10.20129, -9.95529, -9.48229, -8.66829, -7.67329, -6.18629, -3.26729, // NU +-10.21329, -10.21929, -10.22029, -10.22029, -10.22029, -10.20029, -9.95529, -9.48229, -8.66829, -7.67329, -6.18629, -3.26729, +-10.15529, -10.18829, -10.19429, -10.19829, -10.19929, -10.18729, -9.94829, -9.47929, -8.66829, -7.67329, -6.18629, -3.26729, +-9.93929, -9.97629, -10.00329, -10.02529, -10.03229, -10.02729, -9.87729, -9.45429, -8.66329, -7.67229, -6.18529, -3.26729, +-9.38829, -9.39129, -9.39729, -9.40929, -9.41229, -9.40029, -9.35629, -9.21129, -8.61329, -7.66429, -6.18529, -3.26729, +-8.49229, -8.49229, -8.49029, -8.48429, -8.46829, -8.44729, -8.40229, -8.34929, -8.19929, -7.58429, -6.17629, -3.26629, +-7.31629, -7.31629, -7.31529, -7.31229, -7.30429, -7.29229, -7.26329, -7.23029, -7.16429, -7.00929, -6.09029, -3.26329, +-5.86229, -5.86129, -5.86129, -5.86029, -5.85729, -5.85329, -5.84229, -5.83229, -5.81829, -5.79329, -5.46929, -3.23229, +-4.17729, -4.17729, -4.17729, -4.17729, -4.17629, -4.17429, -4.17229, -4.17129, -4.18229, -4.22429, -4.13629, -2.94429, +-2.33929, -2.33929, -2.33929, -2.33929, -2.33929, -2.33829, -2.33829, -2.33929, -2.35529, -2.40729, -2.42329, -1.84329, +-0.41429, -0.41429, -0.41429, -0.41429, -0.41429, -0.41429, -0.41429, -0.41629, -0.42729, -0.46429, -0.49229, -0.23829, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // O18 --> F18 + inline AMREX_GPU_DEVICE table_t j_O18_F18_meta{.ntemp=12, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_O18_F18_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_O18_F18_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_O18_F18_data{ +-99.69897, -88.207, -45.102, -22.822, -13.332, -10.285, -7.744, -6.326997, -4.685921, -2.989331, -1.097718, 1.521493, // RATE +-99.69897, -89.208, -46.103, -23.823, -13.745, -10.307, -7.746, -6.326997, -4.685921, -2.989331, -1.097718, 1.521493, +-99.69897, -90.225, -47.109, -24.824, -14.694, -10.513, -7.76, -6.330997, -4.686921, -2.989331, -1.097718, 1.521493, +-99.69897, -91.385, -48.163, -25.842, -15.699999, -11.334999, -7.901999, -6.361996, -4.69192, -2.989331, -1.097718, 1.521493, +-99.69897, -93.734, -49.666, -27.012997, -16.765992, -12.365994, -8.635997, -6.650993, -4.74591, -2.998317, -1.09871, 1.521493, +-99.69897, -99.69897, -53.848975, -29.286906, -18.315914, -13.669946, -9.772974, -7.616949, -5.187767, -3.080188, -1.10765, 1.520496, +-99.69897, -99.69897, -66.392631, -35.603718, -21.999819, -16.331887, -11.683882, -9.182544, -6.400006, -3.688318, -1.194956, 1.517503, +-99.69897, -99.69897, -97.253221, -51.051718, -30.855502, -22.557891, -15.868936, -12.358386, -8.605652, -5.174857, -1.833263, 1.486592, +-99.69897, -99.69897, -99.69897, -85.193318, -50.283935, -36.129512, -24.924859, -19.181081, -13.199103, -7.915549, -3.325956, 1.195585, +-99.69897, -99.69897, -99.69897, -99.69897, -92.247251, -65.296208, -44.164206, -33.477032, -22.580791, -13.485062, -6.234212, -0.002292, +-99.69897, -99.69897, -99.69897, -99.69897, -99.69897, -99.69897, -87.019583, -65.577418, -43.952925, -26.33003, -12.717824, -2.32723, +-105.79529, -95.58229, -52.17029, -29.57629, -19.82729, -16.61029, -13.87529, -12.31729, -10.47629, -8.52329, -6.28929, -3.17329, // NU +-105.79529, -96.58329, -53.17029, -30.57629, -20.24029, -16.63229, -13.87629, -12.31729, -10.47629, -8.52329, -6.28929, -3.17329, +-105.79529, -97.60029, -54.17629, -31.57829, -21.18829, -16.83829, -13.89029, -12.32029, -10.47629, -8.52329, -6.28929, -3.17329, +-105.79529, -98.76029, -55.23129, -32.59629, -22.19429, -17.66029, -14.03229, -12.35229, -10.48229, -8.52429, -6.28929, -3.17329, +-105.79529, -101.10929, -56.73429, -33.76729, -23.26029, -18.69229, -14.76629, -12.64029, -10.53529, -8.53229, -6.29029, -3.17329, +-105.79529, -105.79529, -60.91629, -36.04129, -24.81029, -19.99529, -15.90329, -13.60729, -10.97729, -8.61429, -6.29929, -3.17329, +-105.79529, -105.79529, -73.46129, -42.35729, -28.49429, -22.65829, -17.81429, -15.17229, -12.19029, -9.22429, -6.38629, -3.17629, +-105.79529, -105.79529, -104.32129, -57.80529, -37.34929, -28.88029, -21.99129, -18.34329, -14.40129, -10.71829, -7.03029, -3.20729, +-105.79529, -105.79529, -105.79529, -91.96529, -56.80629, -42.48829, -31.09229, -25.20929, -19.01629, -13.47729, -8.57129, -3.50129, +-105.79529, -105.79529, -105.79529, -105.79529, -98.78729, -71.68129, -50.37329, -39.56029, -28.48029, -19.15829, -11.57029, -4.70529, +-105.79529, -105.79529, -105.79529, -105.79529, -105.79529, -105.79529, -93.23129, -71.66429, -49.86429, -32.02129, -18.06729, -7.03129, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Na22 --> Ne22 + inline AMREX_GPU_DEVICE table_t j_Na22_Ne22_meta{.ntemp=12, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Na22_Ne22_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Na22_Ne22_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Na22_Ne22_data{ +-8.140485, -8.140823, -8.140863, -8.13089, -6.527984, -5.221884, -4.189497, -3.670155, -3.126789, -2.478029, -1.202487, 1.492835, // RATE +-8.136121, -8.139238, -8.139635, -8.129903, -6.527958, -5.221878, -4.18949, -3.670155, -3.126789, -2.478029, -1.202487, 1.492835, +-8.105992, -8.123892, -8.127601, -8.120177, -6.527627, -5.221804, -4.18944, -3.670108, -3.126698, -2.478029, -1.202487, 1.492835, +-7.980935, -8.006745, -8.025926, -8.033878, -6.524302, -5.220711, -4.188844, -3.669603, -3.126242, -2.477611, -1.202487, 1.492835, +-7.580337, -7.583233, -7.59116, -7.605301, -6.492992, -5.209483, -4.179852, -3.662916, -3.120309, -2.474245, -1.201591, 1.492835, +-6.786369, -6.786369, -6.785414, -6.782103, -6.272767, -5.113505, -4.092669, -3.578263, -3.052233, -2.437469, -1.193411, 1.492835, +-5.702415, -5.702415, -5.701419, -5.699389, -5.502034, -4.60722, -3.615011, -3.101745, -2.579904, -2.090264, -1.116475, 1.496802, +-4.248944, -4.247944, -4.245945, -4.239944, -4.13723, -3.49184, -2.558752, -2.056468, -1.550275, -1.108622, -0.548827, 1.526524, +-0.634, -0.634, -0.633, -0.632, -0.628999, -0.613989, -0.522907, -0.363789, -0.076644, 0.249493, 0.655707, 1.807538, +1.846, 1.846, 1.846, 1.846, 1.846, 1.848, 1.857, 1.877001, 1.933003, 2.034008, 2.217019, 2.853248, +3.869, 3.869, 3.869, 3.869, 3.869, 3.869, 3.872, 3.877, 3.893, 3.924, 3.988, 4.294009, +-14.41529, -14.41729, -14.41729, -14.37929, -12.20629, -10.89029, -9.85329, -9.32529, -8.72229, -7.84129, -6.23729, -3.14729, // NU +-14.39529, -14.40929, -14.41129, -14.37429, -12.20629, -10.89029, -9.85329, -9.32529, -8.72229, -7.84129, -6.23729, -3.14729, +-14.27229, -14.34129, -14.35729, -14.33229, -12.20629, -10.88929, -9.85329, -9.32529, -8.72229, -7.84129, -6.23729, -3.14729, +-13.92229, -13.98129, -14.02629, -14.04729, -12.20029, -10.88729, -9.85129, -9.32329, -8.72129, -7.84029, -6.23729, -3.14729, +-13.27929, -13.28129, -13.29029, -13.30429, -12.15029, -10.86229, -9.82929, -9.30629, -8.70829, -7.83529, -6.23729, -3.14729, +-12.36729, -12.36629, -12.36529, -12.35829, -11.83429, -10.66929, -9.64229, -9.12029, -8.56429, -7.77729, -6.22829, -3.14729, +-11.18629, -11.18529, -11.18529, -11.18129, -10.92029, -9.93829, -8.92829, -8.40429, -7.85929, -7.30829, -6.14529, -3.14429, +-9.67429, -9.67429, -9.67329, -9.67129, -9.51229, -8.69029, -7.71229, -7.20129, -6.68229, -6.20729, -5.54629, -3.11329, +-6.19329, -6.19329, -6.19329, -6.19129, -6.18329, -6.14129, -5.88729, -5.57329, -5.15629, -4.75929, -4.27529, -2.82729, +-3.17729, -3.17729, -3.17729, -3.17729, -3.17629, -3.17429, -3.15529, -3.11629, -3.01529, -2.85029, -2.58629, -1.73429, +-0.73929, -0.73929, -0.73929, -0.73929, -0.73829, -0.73829, -0.73429, -0.72629, -0.70129, -0.65329, -0.55829, -0.13929, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + + // Ne22 --> Na22 + inline AMREX_GPU_DEVICE table_t j_Ne22_Na22_meta{.ntemp=12, .nrhoy=11, .nvars=3, .nheader=5}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Ne22_Na22_rhoy{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}; + inline AMREX_GPU_DEVICE amrex::Array1D j_Ne22_Na22_temp{7.0, 8.0, 8.30103, 8.60206, 8.845098, 9.0, 9.176091, 9.30103, 9.477121, 9.69897, 10.0, 10.477121}; + // Array3D is column-major (Fortran-ordering). T varies fastest, then rho Ye, then the component + inline AMREX_GPU_DEVICE amrex::Array3D + j_Ne22_Na22_data{ +-99.69897, -99.69897, -78.572, -41.337, -25.197999, -18.663995, -13.182982, -10.299883, -7.224534, -4.444142, -1.750046, 1.406071, // RATE +-99.69897, -99.69897, -79.573, -42.337, -25.610998, -18.684995, -13.183982, -10.299883, -7.224534, -4.444142, -1.750046, 1.406071, +-99.69897, -99.69897, -80.578, -43.338999, -26.558978, -18.890991, -13.198981, -10.302882, -7.225531, -4.444142, -1.750046, 1.406071, +-99.69897, -99.69897, -81.633, -44.35699, -27.565777, -19.712943, -13.340974, -10.334873, -7.230514, -4.445122, -1.750046, 1.406071, +-99.69897, -99.69897, -83.136, -45.527863, -28.629609, -20.744424, -14.073863, -10.622754, -7.284321, -4.452958, -1.751007, 1.406071, +-99.69897, -99.69897, -87.318982, -47.790647, -30.141149, -22.041371, -15.209469, -11.587888, -7.723476, -4.534177, -1.759698, 1.406071, +-99.69897, -99.69897, -99.26627, -53.593003, -33.567463, -24.640968, -17.080334, -13.111751, -8.8888, -5.118012, -1.84428, 1.4031, +-99.69897, -99.69897, -99.69897, -66.700408, -40.07502, -28.907956, -19.899424, -15.286844, -10.513206, -6.356952, -2.448879, 1.372341, +-99.69897, -99.69897, -99.69897, -99.110092, -57.843989, -41.122897, -27.943928, -21.234302, -14.357043, -8.599948, -3.768559, 1.083347, +-99.69897, -99.69897, -99.69897, -99.69897, -99.592445, -70.294982, -47.173805, -35.501299, -23.672243, -13.98542, -6.37479, -0.09836, +-99.69897, -99.69897, -99.69897, -99.69897, -99.69897, -99.69897, -90.044876, -67.613551, -45.028226, -26.744171, -12.729879, -2.40644, +-105.79529, -105.79529, -85.63829, -48.08829, -31.69929, -25.01629, -19.34929, -16.33129, -13.06129, -10.03029, -6.97829, -3.29329, // NU +-105.79529, -105.79529, -86.63929, -49.08829, -32.11229, -25.03729, -19.35129, -16.33129, -13.06129, -10.03029, -6.97829, -3.29329, +-105.79529, -105.79529, -87.64429, -50.09029, -33.06129, -25.24329, -19.36529, -16.33429, -13.06229, -10.03029, -6.97829, -3.29329, +-105.79529, -105.79529, -88.69929, -51.10829, -34.06629, -26.06529, -19.50729, -16.36629, -13.06729, -10.03129, -6.97829, -3.29329, +-105.79529, -105.79529, -90.20229, -52.27829, -35.12929, -27.09629, -20.24029, -16.65429, -13.12129, -10.03929, -6.97929, -3.29329, +-105.79529, -105.79529, -94.38429, -54.52929, -36.62929, -28.39329, -21.37529, -17.61829, -13.55929, -10.12029, -6.98829, -3.29329, +-105.79529, -105.79529, -105.79529, -60.39029, -40.10229, -30.95729, -23.22029, -19.11729, -14.71029, -10.70629, -7.07429, -3.29629, +-105.79529, -105.79529, -105.79529, -73.49529, -46.48929, -35.07529, -25.94929, -21.26629, -16.36829, -11.99129, -7.69529, -3.32829, +-105.79529, -105.79529, -105.79529, -105.79529, -64.36429, -47.49129, -34.14029, -27.30929, -20.26729, -14.29629, -9.10029, -3.62029, +-105.79529, -105.79529, -105.79529, -105.79529, -105.79529, -76.68329, -53.38929, -41.59629, -29.60029, -19.70229, -11.79229, -4.81829, +-105.79529, -105.79529, -105.79529, -105.79529, -105.79529, -105.79529, -96.26529, -73.71329, -50.96129, -32.47129, -18.17629, -7.13929, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, // GAMMA +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, +-100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0, + }; + +} + + +AMREX_INLINE AMREX_GPU_DEVICE +amrex::Real +evaluate_linear_1d(const amrex::Real fhi, const amrex::Real flo, const amrex::Real xhi, const amrex::Real xlo, const amrex::Real x) +{ + // This function is a 1-D linear interpolator, that keeps x constant to xlo or xhi, based + // on the side, if x is outside [xlo, xhi] respectively. + + amrex::Real xx = amrex::Clamp(x, xlo, xhi); + amrex::Real f = flo + (fhi - flo) * (xx - xlo) / (xhi - xlo); + + return f; +} + +AMREX_INLINE AMREX_GPU_DEVICE +amrex::Real +evaluate_linear_2d(const amrex::Real fip1jp1, const amrex::Real fip1j, const amrex::Real fijp1, const amrex::Real fij, + const amrex::Real xhi, const amrex::Real xlo, const amrex::Real yhi, const amrex::Real ylo, + const amrex::Real x, const amrex::Real y) +{ + // This is the 2-D linear interpolator, as an extension of evaluate_linear_1d. + + amrex::Real f; + amrex::Real dx = xhi - xlo; + amrex::Real dxinv = 1.0_rt / dx; + amrex::Real dy = yhi - ylo; + amrex::Real dyinv = 1.0_rt / dy; + + amrex::Real E = fij; + amrex::Real C = (fijp1 - fij) * dyinv; + amrex::Real B = (fip1j - fij) * dxinv; + amrex::Real A = (fip1jp1 - B * dx - C * dy - E) * (dxinv * dyinv); + + amrex::Real xx = amrex::Clamp(x, xlo, xhi); + amrex::Real yy = amrex::Clamp(y, ylo, yhi); + + f = A * (xx - xlo) * (yy - ylo) + + B * (xx - xlo) + + C * (yy - ylo) + + E; + + return f; +} + + +template +AMREX_INLINE AMREX_GPU_DEVICE +amrex::Real +evaluate_vars(const int irhoy_lo, const int jtemp_lo, + const R& log_rhoy_table, const T& log_temp_table, const D& data, + const amrex::Real log_rhoy, const amrex::Real log_temp, const int component) +{ + // This function evaluates the 2-D interpolator, for several pairs of rho_ye and temperature. + + int irhoy_hi = irhoy_lo + 1; + int jtemp_hi = jtemp_lo + 1; + + amrex::Real rhoy_lo = log_rhoy_table(irhoy_lo); + amrex::Real rhoy_hi = log_rhoy_table(irhoy_hi); + + amrex::Real t_lo = log_temp_table(jtemp_lo); + amrex::Real t_hi = log_temp_table(jtemp_hi); + + amrex::Real fij = data(jtemp_lo, irhoy_lo, component); + amrex::Real fip1j = data(jtemp_lo, irhoy_hi, component); + amrex::Real fijp1 = data(jtemp_hi, irhoy_lo, component); + amrex::Real fip1jp1 = data(jtemp_hi, irhoy_hi, component); + + amrex::Real r = evaluate_linear_2d(fip1jp1, fip1j, fijp1, fij, + rhoy_hi, rhoy_lo, t_hi, t_lo, log_rhoy, log_temp); + + return r; +} + + +template +AMREX_INLINE AMREX_GPU_DEVICE +amrex::Real +evaluate_dr_dtemp(const int irhoy_lo, const int jtemp_lo, + const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const amrex::Real log_rhoy, const amrex::Real log_temp) +{ + // The main objective of this function is compute dlogr_dlogt. + + const int irhoy_hi = irhoy_lo + 1; + const int jtemp_hi = jtemp_lo + 1; + + amrex::Real dlogr_dlogt; + + //Now we compute the forward finite difference on the boundary + + if ((jtemp_lo - 1 < 1) || (jtemp_hi + 1 > table_meta.ntemp)) { + + // In this case we are in the boundaries of the table. + // At the boundary, we compute the forward-j finite difference + // to compute dlogr_dlogt_i and dlogr_dlogt_ip1, using the + // following stencil: + // + // + // fijp1-----------fip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fij-------------fip1j + // + // with the following result: + // + // dlogr_dlogt_i --------dlogr_dlogt_ip1 + // + // Finally, we perform a 1d-linear interpolation between dlogr_dlogt_ip1 + // and dlogr_dlogt_i to compute dlogr_dlogt + + const amrex::Real log_rhoy_lo = log_rhoy_table(irhoy_lo); + const amrex::Real log_rhoy_hi = log_rhoy_table(irhoy_hi); + + const amrex::Real log_temp_lo = log_temp_table(jtemp_lo); + const amrex::Real log_temp_hi = log_temp_table(jtemp_hi); + + const amrex::Real fij = data(jtemp_lo, irhoy_lo, jtab_rate); + const amrex::Real fip1j = data(jtemp_lo, irhoy_hi, jtab_rate); + const amrex::Real fijp1 = data(jtemp_hi, irhoy_lo, jtab_rate); + const amrex::Real fip1jp1 = data(jtemp_hi, irhoy_hi, jtab_rate); + + const amrex::Real dlogr_dlogt_i = (fijp1 - fij) / (log_temp_hi - log_temp_lo); + const amrex::Real dlogr_dlogt_ip1 = (fip1jp1 - fip1j) / (log_temp_hi - log_temp_lo); + + if ((log_temp < log_temp_lo) || (log_temp > log_temp_hi)) { + dlogr_dlogt = 0.0_rt; + } else { + dlogr_dlogt = evaluate_linear_1d(dlogr_dlogt_ip1, dlogr_dlogt_i, log_rhoy_hi, log_rhoy_lo, log_rhoy); + } + + } else { + + // In this case, we use a bigger stencil to reconstruct the + // temperature derivatives in the j and j+1 temperature positions, + // using the cetral-j finite differences: + // + // fijp2 ------------fip1jp2 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fijp1------------fip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fij------------- fip1j + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fijm1------------fip1jm1 + // + // with the following result: + // + // + // dr_dt_ijp1 --------dr_dt_ip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // dr_dt_ij-----------dr_dt_ip1j + // + // Finally, we perform a 2d-linear interpolation to + // compute dlogr_dlogt. + + const amrex::Real log_temp_jm1 = log_temp_table(jtemp_lo-1); + const amrex::Real log_temp_j = log_temp_table(jtemp_lo); + const amrex::Real log_temp_jp1 = log_temp_table(jtemp_hi); + const amrex::Real log_temp_jp2 = log_temp_table(jtemp_hi+1); + + const amrex::Real log_rhoy_lo = log_rhoy_table(irhoy_lo); + const amrex::Real log_rhoy_hi = log_rhoy_table(irhoy_hi); + + const amrex::Real fijm1 = data(jtemp_lo-1, irhoy_lo, jtab_rate); + const amrex::Real fij = data(jtemp_lo, irhoy_lo, jtab_rate); + const amrex::Real fijp1 = data(jtemp_hi, irhoy_lo, jtab_rate); + const amrex::Real fijp2 = data(jtemp_hi+1, irhoy_lo, jtab_rate); + + const amrex::Real fip1jm1 = data(jtemp_lo-1, irhoy_hi, jtab_rate); + const amrex::Real fip1j = data(jtemp_lo, irhoy_hi, jtab_rate); + const amrex::Real fip1jp1 = data(jtemp_hi, irhoy_hi, jtab_rate); + const amrex::Real fip1jp2 = data(jtemp_hi+1, irhoy_hi, jtab_rate); + + const amrex::Real dlogTinv1 = 1.0_rt / (log_temp_jp1 - log_temp_jm1); + const amrex::Real dlogTinv2 = 1.0_rt / (log_temp_jp2 - log_temp_j); + const amrex::Real dlogr_dlogt_ij = (fijp1 - fijm1) * dlogTinv1; + const amrex::Real dlogr_dlogt_ijp1 = (fijp2 - fij) * dlogTinv2; + const amrex::Real dlogr_dlogt_ip1j = (fip1jp1 - fip1jm1) * dlogTinv1; + const amrex::Real dlogr_dlogt_ip1jp1 = (fip1jp2 - fip1j) * dlogTinv2; + + dlogr_dlogt = evaluate_linear_2d(dlogr_dlogt_ip1jp1, dlogr_dlogt_ip1j, dlogr_dlogt_ijp1, dlogr_dlogt_ij, + log_rhoy_hi, log_rhoy_lo, log_temp_jp1, log_temp_j, + log_rhoy, log_temp); + + } + return dlogr_dlogt; +} + + +template +AMREX_INLINE AMREX_GPU_DEVICE +void +get_entries(const int irhoy_lo, const int jtemp_lo, + const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const amrex::Real log_rhoy, const amrex::Real log_temp, amrex::Array1D& entries) +{ + + // only interpolate the quantities we currently use + + entries(jtab_rate) = evaluate_vars(irhoy_lo, jtemp_lo, + log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, jtab_rate); + + entries(jtab_nuloss) = evaluate_vars(irhoy_lo, jtemp_lo, + log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, jtab_nuloss); + + entries(jtab_gamma) = evaluate_vars(irhoy_lo, jtemp_lo, + log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, jtab_gamma); + + entries(k_index_dlogr_dlogt) = + evaluate_dr_dtemp(irhoy_lo, jtemp_lo, + table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp); +} + +template +AMREX_INLINE AMREX_GPU_DEVICE +void +tabular_evaluate(const table_t& table_meta, + const R& log_rhoy_table, const T& log_temp_table, const D& data, + const amrex::Real log_rhoy, const amrex::Real log_temp, const amrex::Real temp, + amrex::Real& rate, amrex::Real& drate_dt, amrex::Real& edot_nu, amrex::Real& edot_gamma) +{ + amrex::Array1D entries; + + // Get the table entries at this rhoy, temp + + // get the index into the table -- all components are + // stored with the same indices + + const int irhoy_lo = interp_net::find_index_extrap(log_rhoy, log_rhoy_table); + const int jtemp_lo = interp_net::find_index_extrap(log_temp, log_temp_table); + + get_entries(irhoy_lo, jtemp_lo, + table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, entries); + + // Fill outputs: rate, d(rate)/d(temperature), and + // (negative) neutrino loss contribution to energy generation + + rate = amrex::Math::exp10(entries(jtab_rate)); + drate_dt = rate * entries(k_index_dlogr_dlogt) / temp; + edot_nu = -amrex::Math::exp10(entries(jtab_nuloss)); + edot_gamma = amrex::Math::exp10(entries(jtab_gamma)); +} + +#endif diff --git a/networks/he-burn/ase-big/temperature_table_rates.H b/networks/he-burn/ase-big/temperature_table_rates.H new file mode 100644 index 000000000..849033267 --- /dev/null +++ b/networks/he-burn/ase-big/temperature_table_rates.H @@ -0,0 +1,36 @@ +#ifndef TEMPERATURE_TABLE_RATES_H +#define TEMPERATURE_TABLE_RATES_H + +#include + +#include +#include +#include + +using namespace amrex::literals; + +using namespace Rates; + + +namespace temp_tabular { + + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + void + fill_rates(const tf_t& tfactors, T& rate_eval) + { + + amrex::ignore_unused(tfactors); + amrex::ignore_unused(rate_eval); + + [[maybe_unused]] amrex::Real rate; + [[maybe_unused]] amrex::Real drate_dT; + + + + } + + +} +#endif diff --git a/networks/he-burn/ase-big/tfactors.H b/networks/he-burn/ase-big/tfactors.H new file mode 100644 index 000000000..f363363a3 --- /dev/null +++ b/networks/he-burn/ase-big/tfactors.H @@ -0,0 +1,34 @@ +#ifndef TFACTORS_H +#define TFACTORS_H + +struct tf_t { + amrex::Real T9; + amrex::Real T9i; + amrex::Real T943i; + amrex::Real T923i; + amrex::Real T913i; + amrex::Real T913; + amrex::Real T923; + amrex::Real T953; + amrex::Real lnT9; +}; + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +tf_t evaluate_tfactors(const amrex::Real T) +{ + + tf_t tf; + tf.T9 = T * 1.e-9_rt; + tf.T9i = 1.0_rt / tf.T9; + tf.T913 = std::cbrt(tf.T9); + tf.T913i = 1.0_rt / tf.T913; + tf.T923i = tf.T913i * tf.T913i; + tf.T943i = tf.T9i * tf.T913i; + tf.T923 = tf.T913 * tf.T913; + tf.T953 = tf.T9 * tf.T923; + tf.lnT9 = std::log(tf.T9); + + return tf; +} + +#endif