-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'param' into Decompose_CUDA
- Loading branch information
Showing
16 changed files
with
831 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#EQUATIONS | ||
|
||
<1> NO2 + hv = NO + O3P : 6.69e-1*(SUN/60.0e0); | ||
<2> O3P + O2 + AIR = O3 : ARR_ac(5.68e-34, -2.80e0); | ||
<3> O3P + O3 = 2O2 : ARR_ab(8.00e-12, 2060.0e0); | ||
<4> O3P + NO + AIR = NO2 : ARR_ac(1.00e-31, -1.60e0); | ||
<5> O3P + NO2 = NO : ARR_ab(6.50e-12,- 120.0e0); | ||
<7> O3 + NO = NO2 : ARR_ab(1.80e-12, 1370.0e0); | ||
<8> O3 + NO2 = NO3 : ARR_ab(1.40e-13, 2470.0e0); | ||
<9> NO + NO3 = 2NO2 : ARR_ab(1.80e-11, -110.0e0); | ||
<10> NO + NO + O2 = 2NO2 : ARR_ab(3.30e-39, -530.0e0); | ||
<14> NO2 + NO3 = NO + NO2 : ARR_ab(4.50e-14, 1260.0e0); | ||
<15> NO3 + hv = NO : 1.59e0*(SUN/60.0e0); | ||
<16> NO3 + hv = NO2 + O3P : 1.50e+1*(SUN/60.0e0); | ||
<17> O3 + hv = O3P : 3.76e-2*(SUN/60.0e0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#INCLUDE atoms.kpp | ||
|
||
#DEFVAR | ||
|
||
O3 = 3O; | ||
H2O2 = 2H + 2O; | ||
NO = N + O; | ||
NO2 = N + 2O; | ||
NO3 = N + 3O; | ||
O3P = O; | ||
|
||
|
||
|
||
#DEFFIX | ||
AIR = IGNORE; | ||
O2 = 2O; | ||
H2O = 2H + O; | ||
H2 = 2H; | ||
CH4 = C + 4H; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
Copyright (C) 2023 | ||
National Center for Atmospheric Research, | ||
SPDX-License-Identifier: Apache-2.0 | ||
File: | ||
test_kpp_to_micm.py | ||
Usage: | ||
pytest test_kpp_to_micm.py --log-cli-level=DEBUG | ||
""" | ||
|
||
import kpp_to_micm | ||
|
||
def test_parse_kpp_arrhenius(): | ||
""" | ||
examples | ||
ARR_ab(1.0e-12, 2000.0) | ||
ARR_ac(1.0e-12, -3.0) | ||
ARR_abc(1.0e-12, 2000.0, -3.0) | ||
""" | ||
|
||
kpp_A, kpp_B, kpp_C = 1.0e-12, 2000.0, -3.0 | ||
|
||
arr_dict = kpp_to_micm.parse_kpp_arrhenius( | ||
'ARR_ab(%.2e, %.2f)' % (kpp_A, kpp_B)) | ||
assert arr_dict['A'] == kpp_A | ||
assert arr_dict['C'] == - kpp_B | ||
|
||
arr_dict = kpp_to_micm.parse_kpp_arrhenius( | ||
'ARR_ac(%.2e, %.2f)' % (kpp_A, kpp_C)) | ||
assert arr_dict['A'] == kpp_A | ||
assert arr_dict['B'] == kpp_C | ||
|
||
arr_dict = kpp_to_micm.parse_kpp_arrhenius( | ||
'ARR_abc(%.2e, %.2f, %.2f)' % (kpp_A, kpp_B, kpp_C)) | ||
assert arr_dict['A'] == kpp_A | ||
assert arr_dict['C'] == - kpp_B | ||
assert arr_dict['B'] == kpp_C | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
#pragma once | ||
#include <micm/util/cuda_param.hpp> | ||
|
||
namespace micm | ||
{ | ||
namespace cuda | ||
{ | ||
void AddForcingTerms_kernelSetup( | ||
const double* rate_constants_data, | ||
const double* state_variables_data, | ||
double* forcing_data, | ||
int ngrids, | ||
int nrxns, | ||
int nspecs, | ||
const size_t* number_of_reactants, | ||
int number_of_reactants_size, | ||
const size_t* reactant_ids, | ||
int reactant_ids_size, | ||
const size_t* number_of_products, | ||
int number_of_products_size, | ||
const size_t* product_ids, | ||
int product_ids_size, | ||
const double* yields, | ||
int yields_size); | ||
std::chrono::nanoseconds AddForcingTermsKernelDriver( | ||
CUDAMatrixParam& matrixParam, | ||
CUDAProcessSetParam& processSet); | ||
|
||
std::chrono::nanoseconds AddJacobianTermsKernelDriver( | ||
CUDAMatrixParam& matrixParam, | ||
CUDAProcessSetParam& processSet); | ||
} // namespace cuda | ||
} // namespace micm |
Oops, something went wrong.