Skip to content

Commit 6ccf6d4

Browse files
committed
Merge branch 'kernel_efficiencies_fix' of https://github.com/pdziekan/libcloudphxx into kernel_efficiencies_fix
2 parents 8bb3ce1 + a45939f commit 6ccf6d4

15 files changed

+139
-8289
lines changed

src/detail/kernel_definitions/hall_davis_no_waals_efficiencies.hpp renamed to src/detail/kernel_definitions/hall_davis_no_waals_efficiencies_like_in_EFM.hpp

File renamed without changes.

src/detail/kernel_definitions/hall_efficiencies.hpp

Lines changed: 23 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace libcloudphxx
1111
return 300.e-6; // not used?
1212
}
1313

14-
const int hall_n_rad = 15;
14+
const int hall_n_rad = 11;
1515
const int hall_n_rat = 21;
1616

1717
template<class real_t>
@@ -20,69 +20,27 @@ namespace libcloudphxx
2020
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
2121
const real_t arr[hall_n_rat][hall_n_rad] =
2222
{
23-
{0, 0, 0, 0, 0,
24-
0, 0, 0, 0, 0,
25-
0, 0, 0, 0, 0},
26-
{0, 0, 0.0001, 0.0001, 0.0001,
27-
0, 0.000733, 0.001, 0.084, 0.05,
28-
0.2543, 0.5, 0.7807, 0.87, 0.97},
29-
{0, 0, 0.0001, 0.001733, 0.0001,
30-
0.00563, 0.002, 0.07, 0.4, 0.43,
31-
0.58, 0.79, 0.93, 0.96, 1},
32-
{0, 0, 0.014, 0.001733, 0.005,
33-
0.0156, 0.02667, 0.28, 0.62, 0.64,
34-
0.7629, 0.91, 0.9687, 0.98, 1},
35-
{0, 0, 0.014, 0.015, 0.016,
36-
0.028, 0.04, 0.5, 0.7, 0.77,
37-
0.84, 0.95, 0.95, 1, 1},
38-
{0, 0, 0.019, 0.02117, 0.022,
39-
0.0484, 0.1133, 0.62, 0.79, 0.84,
40-
0.8829, 0.95, 1, 1, 1},
41-
{0, 0, 0.019, 0.02983, 0.03,
42-
0.1226, 0.17, 0.68, 0.83, 0.87,
43-
0.9, 1, 1, 1, 1},
44-
{0, 0, 0.027, 0.02983, 0.043,
45-
0.1704, 0.3133, 0.74, 0.864, 0.89,
46-
0.9229, 1, 1, 1, 1},
47-
{0, 0, 0.027, 0.0395, 0.052,
48-
0.226, 0.4, 0.78, 0.88, 0.9,
49-
0.94, 1, 1, 1, 1},
50-
{0, 0, 0.033, 0.04883, 0.064,
51-
0.2708, 0.5167, 0.8, 0.9, 0.91,
52-
0.95, 1, 1, 1, 1},
53-
{0, 0, 0.033, 0.0555, 0.072,
54-
0.3184, 0.55, 0.8, 0.9, 0.91,
55-
0.95, 1, 1, 1, 1},
56-
{0, 0, 0.037, 0.0555, 0.079,
57-
0.3308, 0.5833, 0.8, 0.9, 0.91,
58-
0.95, 1, 1, 1, 1},
59-
{0, 0, 0.037, 0.0595, 0.082,
60-
0.336, 0.59, 0.78, 0.9, 0.91,
61-
0.95, 1, 1, 1, 1},
62-
{0, 0, 0.038, 0.05833, 0.08,
63-
0.3312, 0.5667, 0.77, 0.888, 0.91,
64-
0.95, 1, 1, 1, 1},
65-
{0, 0, 0.038, 0.05367, 0.076,
66-
0.3002, 0.54, 0.76, 0.88, 0.92,
67-
0.95, 1, 1, 1, 1},
68-
{0, 0, 0.036, 0.05367, 0.067,
69-
0.2855, 0.5033, 0.77, 0.882, 0.93,
70-
0.9743, 1, 1, 1, 1},
71-
{0, 0, 0.036, 0.0465, 0.057,
72-
0.2735, 0.49, 0.77, 0.89, 0.95,
73-
1, 1, 1, 1, 1},
74-
{0, 0, 0.032, 0.03967, 0.048,
75-
0.2619, 0.4633, 0.78, 0.938, 1,
76-
1.023, 1, 1, 1, 1},
77-
{0, 0, 0.032, 0.03267, 0.04,
78-
0.2476, 0.45, 0.79, 1.01, 1.03,
79-
1.04, 1, 1, 1, 1},
80-
{0, 0, 0.027, 0.03267, 0.033,
81-
0.2559, 0.4867, 0.95, 1.5, 1.7,
82-
2.543, 1, 1, 1, 1},
83-
{0, 0, 0.027, 0.027, 0.027,
84-
0.2735, 0.52, 1.4, 2.3, 3,
85-
4, 1, 1, 1, 1}
23+
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
24+
{.0001, .0001, .0001, .001, .005, .05, .2, .5, .77, .87, .97},
25+
{.0001, .0001, .002, .07, .4, .43, .58, .79, .93, .96, 1.},
26+
{.0001, .005, .02, .28, .6, .64, .75, .91, .97, .98, 1.},
27+
{.014, .016, .04, .5, .7, .77, .84, .95, .97, 1., 1.},
28+
{.017, .022, .085, .62, .78, .84, .88, .95, 1., 1., 1.},
29+
{.019, .03, .17, .68, .83, .87, .9, 1., 1., 1, 1},
30+
{.022, .043, .27, .74, .86, .89, .92, 1, 1, 1, 1},
31+
{.027, .05, .4, .78, .88, .9, .94, 1, 1, 1, 1},
32+
{.03, .064, .5, .8, .9, .91, .95, 1, 1, 1, 1},
33+
{.033, .072, .55, .8, .9, .91, .95, 1, 1, 1, 1},
34+
{.035, .079, .58, .8, .9, .91, .95, 1, 1, 1, 1},
35+
{.037, .082, .59, .78, .9, .91, .95, 1, 1, 1, 1},
36+
{.038, .08, .58, .77, .89, .91, .95, 1, 1, 1, 1},
37+
{.038, .076, .54, .76, .88, .92, .95, 1, 1, 1, 1},
38+
{.037, .067, .51, .77, .88, .93, .97, 1, 1, 1, 1},
39+
{.036, .057, .49, .77, .89, .95, 1, 1, 1, 1, 1},
40+
{.035, .048, .47, .78, .92, 1, 1.02, 1, 1, 1, 1},
41+
{.032, .04, .45, .79, 1.01, 1.03, 1.04, 1., 1., 1. ,1.},
42+
{.029, .033, .47, .95, 1.3, 1.7, 2.3, 1., 1., 1, 1},
43+
{.027, .027, .52, 1.4, 2.3, 3, 4, 1, 1, 1, 1}
8644
};
8745

8846
vec = std::vector<real_t>(&(arr[0][0]), &(arr[hall_n_rat][hall_n_rad]));
@@ -92,7 +50,7 @@ namespace libcloudphxx
9250
void hall_radii(std::vector<real_t> &vec)
9351
{
9452
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
95-
const real_t arr[hall_n_rad] = {6.e-6,8.e-6,10.e-6,15.e-6,20.e-6,25.e-6,30.e-6,40.e-6,50.e-6,60.e-6,70.e-6,100.e-6,150.e-6,200.e-6,300.e-6};
53+
const real_t arr[hall_n_rad] = {10.e-6,20.e-6,30.e-6,40.e-6,50.e-6,60.e-6,70.e-6,100.e-6,150.e-6,200.e-6,300.e-6};
9654

9755
vec = std::vector<real_t>(arr, arr + hall_n_rad );
9856
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#pragma once
2+
namespace libcloudphxx
3+
{
4+
namespace lgrngn
5+
{
6+
namespace detail
7+
{
8+
template<class real_t>
9+
real_t hall_r_max()
10+
{
11+
return 300.e-6; // not used?
12+
}
13+
14+
const int hall_n_rad = 15;
15+
const int hall_n_rat = 21;
16+
17+
template<class real_t>
18+
void hall_efficiencies(std::vector<real_t> &vec)
19+
{
20+
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
21+
const real_t arr[hall_n_rat][hall_n_rad] =
22+
{
23+
{0, 0, 0, 0, 0,
24+
0, 0, 0, 0, 0,
25+
0, 0, 0, 0, 0},
26+
{0, 0, 0.0001, 0.0001, 0.0001,
27+
0, 0.000733, 0.001, 0.084, 0.05,
28+
0.2543, 0.5, 0.7807, 0.87, 0.97},
29+
{0, 0, 0.0001, 0.001733, 0.0001,
30+
0.00563, 0.002, 0.07, 0.4, 0.43,
31+
0.58, 0.79, 0.93, 0.96, 1},
32+
{0, 0, 0.014, 0.001733, 0.005,
33+
0.0156, 0.02667, 0.28, 0.62, 0.64,
34+
0.7629, 0.91, 0.9687, 0.98, 1},
35+
{0, 0, 0.014, 0.015, 0.016,
36+
0.028, 0.04, 0.5, 0.7, 0.77,
37+
0.84, 0.95, 0.95, 1, 1},
38+
{0, 0, 0.019, 0.02117, 0.022,
39+
0.0484, 0.1133, 0.62, 0.79, 0.84,
40+
0.8829, 0.95, 1, 1, 1},
41+
{0, 0, 0.019, 0.02983, 0.03,
42+
0.1226, 0.17, 0.68, 0.83, 0.87,
43+
0.9, 1, 1, 1, 1},
44+
{0, 0, 0.027, 0.02983, 0.043,
45+
0.1704, 0.3133, 0.74, 0.864, 0.89,
46+
0.9229, 1, 1, 1, 1},
47+
{0, 0, 0.027, 0.0395, 0.052,
48+
0.226, 0.4, 0.78, 0.88, 0.9,
49+
0.94, 1, 1, 1, 1},
50+
{0, 0, 0.033, 0.04883, 0.064,
51+
0.2708, 0.5167, 0.8, 0.9, 0.91,
52+
0.95, 1, 1, 1, 1},
53+
{0, 0, 0.033, 0.0555, 0.072,
54+
0.3184, 0.55, 0.8, 0.9, 0.91,
55+
0.95, 1, 1, 1, 1},
56+
{0, 0, 0.037, 0.0555, 0.079,
57+
0.3308, 0.5833, 0.8, 0.9, 0.91,
58+
0.95, 1, 1, 1, 1},
59+
{0, 0, 0.037, 0.0595, 0.082,
60+
0.336, 0.59, 0.78, 0.9, 0.91,
61+
0.95, 1, 1, 1, 1},
62+
{0, 0, 0.038, 0.05833, 0.08,
63+
0.3312, 0.5667, 0.77, 0.888, 0.91,
64+
0.95, 1, 1, 1, 1},
65+
{0, 0, 0.038, 0.05367, 0.076,
66+
0.3002, 0.54, 0.76, 0.88, 0.92,
67+
0.95, 1, 1, 1, 1},
68+
{0, 0, 0.036, 0.05367, 0.067,
69+
0.2855, 0.5033, 0.77, 0.882, 0.93,
70+
0.9743, 1, 1, 1, 1},
71+
{0, 0, 0.036, 0.0465, 0.057,
72+
0.2735, 0.49, 0.77, 0.89, 0.95,
73+
1, 1, 1, 1, 1},
74+
{0, 0, 0.032, 0.03967, 0.048,
75+
0.2619, 0.4633, 0.78, 0.938, 1,
76+
1.023, 1, 1, 1, 1},
77+
{0, 0, 0.032, 0.03267, 0.04,
78+
0.2476, 0.45, 0.79, 1.01, 1.03,
79+
1.04, 1, 1, 1, 1},
80+
{0, 0, 0.027, 0.03267, 0.033,
81+
0.2559, 0.4867, 0.95, 1.5, 1.7,
82+
2.543, 1, 1, 1, 1},
83+
{0, 0, 0.027, 0.027, 0.027,
84+
0.2735, 0.52, 1.4, 2.3, 3,
85+
4, 1, 1, 1, 1}
86+
};
87+
88+
vec = std::vector<real_t>(&(arr[0][0]), &(arr[hall_n_rat][hall_n_rad]));
89+
}
90+
91+
template<class real_t>
92+
void hall_radii(std::vector<real_t> &vec)
93+
{
94+
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
95+
const real_t arr[hall_n_rad] = {6.e-6,8.e-6,10.e-6,15.e-6,20.e-6,25.e-6,30.e-6,40.e-6,50.e-6,60.e-6,70.e-6,100.e-6,150.e-6,200.e-6,300.e-6};
96+
97+
vec = std::vector<real_t>(arr, arr + hall_n_rad );
98+
}
99+
100+
template<class real_t>
101+
void hall_ratios(std::vector<real_t> &vec)
102+
{
103+
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
104+
const real_t arr[hall_n_rat] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5, 0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0};
105+
106+
vec = std::vector<real_t>(arr, arr + hall_n_rat );
107+
}
108+
}
109+
}
110+
}

src/detail/kernel_definitions_old/hall_davis_no_waals_efficiencies.hpp renamed to src/detail/kernel_definitions_Jon/hall_davis_no_waals_efficiencies.hpp

File renamed without changes.

src/detail/kernel_definitions_old/hall_efficiencies.hpp renamed to src/detail/kernel_definitions_Jon/hall_efficiencies.hpp

File renamed without changes.

src/detail/kernel_definitions/hall_pinsky_1000mb_grav_efficiencies.hpp renamed to src/detail/kernel_definitions_Jon/hall_pinsky_1000mb_grav_efficiencies.hpp

File renamed without changes.

src/detail/kernel_definitions/hall_pinsky_cumulonimbus_efficiencies.hpp renamed to src/detail/kernel_definitions_Jon/hall_pinsky_cumulonimbus_efficiencies.hpp

File renamed without changes.

src/detail/kernel_definitions/hall_pinsky_stratocumulus_efficiencies.hpp renamed to src/detail/kernel_definitions_Jon/hall_pinsky_stratocumulus_efficiencies.hpp

File renamed without changes.

src/detail/kernel_definitions/vohl_davis_no_waals_efficiencies.hpp renamed to src/detail/kernel_definitions_Jon/vohl_davis_no_waals_efficiencies.hpp

File renamed without changes.

0 commit comments

Comments
 (0)