Skip to content

Commit

Permalink
Refined grid levels at the bottom for predefined levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
janhclem authored Jan 15, 2024
1 parent 99eea2e commit bfe97a1
Showing 1 changed file with 74 additions and 3 deletions.
77 changes: 74 additions & 3 deletions src/libtrac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ double lapse_rate(

void level_definitions(
ctl_t * ctl) {

if (0 == ctl->press_level_def) {

ctl->met_np = 138;
Expand Down Expand Up @@ -1630,11 +1630,82 @@ void level_definitions(
for (int ip = 0; ip < ctl->met_np; ip++)
ctl->met_p[ctl->met_np - ip - 1] = press[ip];

} else if (3 == ctl->press_level_def) {

ctl->met_np = 147;

double press[147] = {
0.0200, 0.0310, 0.0467, 0.0683, 0.0975, 0.1361, 0.1861, 0.2499,
0.3299, 0.4288, 0.5496, 0.6952, 0.8690, 1.0742, 1.3143, 1.5928, 1.9134,
2.2797, 2.6954, 3.1642, 3.6898, 4.2759, 4.9262, 5.6441, 6.4334, 7.2974,
8.2397, 9.2634, 10.3720, 11.5685, 12.8561, 14.2377, 15.7162, 17.2945,
18.9752, 20.7610, 22.6543, 24.6577, 26.7735, 29.0039, 31.3512, 33.8174,
36.4047, 39.1149, 41.9493, 44.9082, 47.9915, 51.1990, 54.5299, 57.9834,
61.5607, 65.2695, 69.1187, 73.1187, 77.2810, 81.6182, 86.1450, 90.8774,
95.8280, 101.0047, 106.4153, 112.0681, 117.9714, 124.1337, 130.5637,
137.2703, 144.2624, 151.5493, 159.1403, 167.0450, 175.2731, 183.8344,
192.7389, 201.9969, 211.6186, 221.6146, 231.9954, 242.7719, 253.9549,
265.5556, 277.5852, 290.0548, 302.9762, 316.3607, 330.2202, 344.5663,
359.4111, 374.7666, 390.6450, 407.0583, 424.0190, 441.5395, 459.6321,
478.3096, 497.5845, 517.4198, 537.7195, 558.3430, 579.1926, 600.1668,
621.1624, 642.0764, 662.8084, 683.2620, 703.3467, 722.9795, 742.0855,
760.5996, 778.4661, 795.6396, 812.0847, 827.7756, 842.6959, 856.8376,
870.2004, 882.7910, 894.6222, 905.7116, 916.0815, 925.7571, 934.7666,
943.1399, 950.9082, 958.1037, 964.7584, 970.9046, 976.5737, 981.7968,
986.6036, 991.0230, 995.0824, 998.8081, 1002.2250, 1005.3562, 1008.2239,
1010.8487, 1013.25, 1016.37, 1019.49, 1022.61, 1025.73, 1028.85, 1031.97,
1035.09, 1038.21, 1041.33, 1044.45
};

for (int ip = 0; ip < ctl->met_np; ip++)
ctl->met_p[ctl->met_np - ip - 1] = press[ip];

} else if (4 == ctl->press_level_def) {

ctl->met_np = 101;

double press[101] = {
0.0200, 0.0398, 0.0739, 0.1291, 0.2141, 0.3395, 0.5175, 0.7617,
1.0872, 1.5099, 2.0464, 2.7136, 3.5282, 4.5069, 5.6652, 7.0181,
8.5795, 10.3617, 12.3759, 14.6316, 17.1371, 19.8987, 22.9216, 26.2090,
29.7630, 33.5843, 37.6720, 42.0242, 46.6378, 51.5086, 56.6316, 61.9984,
67.5973, 73.4150, 79.4434, 85.7016, 92.2162, 99.0182, 106.1445, 113.6382,
121.5502, 129.9403, 138.8558, 148.3260, 158.3816, 169.0545, 180.3786,
192.3889, 205.1222, 218.6172, 232.9140, 248.0547, 264.0833, 281.0456,
298.9895, 317.9651, 338.0245, 359.2221, 381.6144, 405.2606, 430.2069,
456.4813, 483.8505, 512.0662, 540.8577, 569.9401, 599.0310, 627.9668,
656.6129, 684.8491, 712.5573, 739.5739, 765.7697, 791.0376, 815.2774,
838.3507, 860.1516, 880.6080, 899.6602, 917.2205, 933.2247, 947.6584,
960.5245, 971.8169, 981.5301, 989.7322, 996.8732, 1002.8013,
1007.4431, 1010.8487, 1013.25, 1016.37, 1019.49, 1022.61, 1025.73, 1028.85, 1031.97,
1035.09, 1038.21, 1041.33, 1044.45
};

for (int ip = 0; ip < ctl->met_np; ip++)
ctl->met_p[ctl->met_np - ip - 1] = press[ip];

} else if (5 == ctl->press_level_def) {

ctl->met_np = 62;

double press[62] = {
0.01, 0.1361, 0.2499, 0.4288, 0.6952, 1.0742,
2.2797, 3.1642, 4.2759, 7.2974, 9.2634, 11.5685, 14.2377, 20.761,
24.6577, 33.8174, 39.1149, 51.199, 57.9834, 73.1187, 81.6182,
90.8774, 101.005, 112.068, 124.134, 137.27, 151.549, 167.045, 183.834,
201.997, 221.615, 242.772, 265.556, 290.055, 316.361, 344.566, 374.767,
407.058, 441.539, 478.31, 517.42, 558.343, 600.167, 683.262, 722.979,
760.6, 795.64, 827.776, 856.838, 882.791, 905.712, 925.757, 943.14,
958.104, 972.495, 986.886, 1001.28, 1015.67, 1030.06 , 1034.86, 1039.65, 1044.45
};

for (int ip = 0; ip < ctl->met_np; ip++)
ctl->met_p[ctl->met_np - ip - 1] = press[ip];

} else {
ERRMSG
("Definition does not exist, use 0 for l137, 1 for l91 or 2 for l60")
("Definition does not exist, use 0 for l137, 1 for l91 or 2 for l60.")
}

}

/*****************************************************************************/
Expand Down

0 comments on commit bfe97a1

Please sign in to comment.